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

broken fastify-kafka implementation when using rdkafka bigger than 2.14.0 #1016

Closed
Uzlopak opened this issue May 17, 2023 · 4 comments · Fixed by #1017
Closed

broken fastify-kafka implementation when using rdkafka bigger than 2.14.0 #1016

Uzlopak opened this issue May 17, 2023 · 4 comments · Fixed by #1017

Comments

@Uzlopak
Copy link

Uzlopak commented May 17, 2023

See
fastify/fastify-kafka#99

We had to revert to version 2.14.0 to ensure everything works properly. I assume it is because of #982 by @GaryWilber (no blame on him). It seems that the connection is not disconnected properly and so the test runner hangs.

@Uzlopak Uzlopak changed the title n brl+ May 17, 2023
@Uzlopak Uzlopak changed the title brl+ broken fastify-kafka implementation when using rdkafka bigger than 2.14.0 May 17, 2023
@whackenb
Copy link

I could confirm with why-is-node-running that two threads introduced with 2.14.0 are not terminated. As only our tests were affected, we currently explicitly exit the process as a workaround.

@GaryWilber
Copy link
Collaborator

Thanks for reporting this. I have not seen this behavior myself since my service calls process.exit when exiting.

I made a fix in #1017. Would one of you be able to try that change out and verify it fixes the issue?

@whackenb
Copy link

Thanks a lot for the quick fix. :)

I could verify that our integration tests terminate when using version 2.16.1 build from branch 'user/garywilb/consume_loop_disconnect', while the process keeps running with version 2.15.0.

We shut down our consumer and producers by publishing a shutdown event:

process.on('shutdown', () => {
	if (consumer.isConnected()) {
		logger.info('Disconnecting from cluster...');
		consumer.disconnect(handleKafkaError);
	}
});

consumer.on('disconnected', () => {
	logger.info('Disconnected from cluster');
});

No process.exit is present, and test framework mocha is called without the --exit flag. The disconnect log messages are present and all expected messages are published/consumed, so I think the issue is resolved by the change.

@Uzlopak
Copy link
Author

Uzlopak commented May 26, 2023

@GaryWilber

Thank you for the fast fix ;).

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 a pull request may close this issue.

3 participants