Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disconnect from Kafka on process exit #134

Merged
merged 5 commits into from
Mar 15, 2024

Conversation

kalinkrustev
Copy link
Contributor

When deployments in k8s are restarted or scaled down, the pods that get terminated must make sure that all created consumers are explicitly disconnected. If consumers are not disconnected, Kafka still sees the old connections and there is and increased delay for rebalancing the corresponding consumer group.

The process exit event does not allow async processing, that's why this helper module is used.

Copy link

sonarcloud bot commented Mar 12, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@kalinkrustev
Copy link
Contributor Author

I checked other places where signals events are attached, all I saw call process.exit() at most 10 seconds after the signal. This also the default of async-exit-hook, so it should work fine.

@vijayg10 vijayg10 merged commit 21f9119 into mojaloop:master Mar 15, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants