Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @LGouellec
This PR is the follow up to my PR from month ago: #379
Short TLDR of problems that we encountered in our project:
Our application is running in a docker container and during its life we create and close a lot of instances of KafkaStream. After our QA team started running tests on it, we saw that container with service responsible for stream processing is closed by OS with message that it reached maximum number of tasks allowed by config. After some debugging I found out that most of the task are pointing to Kafka connections
Example listing of tasks under container with running stream:
From what I was able to find out tasks with prefix
rdk:
are created by lib handling connecting to Kafka. And mostly those tasks were left after complete shutdown of stream processing. My changes in PR from October (calling close on admin client) helped in reducing number of dangling task significantly, but there were still some leftovers.This PR includes two changes:
Console logger
, to combat this I propose allowing to pass ILoggerFactory directly to StreamConfig() and creating separate factory only when it is not passed to constructorWith this two changes I was able to achieve state when number of tasks is the same in freshly started container and one that was running for some time with all streams closed. So, no more dangling tasks, it looks like everything is disposed now :)