Kafka emitter wasn't given the correct number of threads. #15719
Merged
jon-wei merged 1 commit intoapache:masterfrom Jan 18, 2024
Merged
Conversation
…e 1 thread per scheduled task. This change intelligently provisions the correct number of threads per scheduled task. 1 for each event type, and 1 for logging the lost events. This is a change to make this work. But in the future it would be worthwhile to make each task not be greedy and share threads so there isn't a need of a thread per task.
jon-wei
approved these changes
Jan 18, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes issue with kafka emitter not having the correct number of threads
Description
The kafka emitter didn't have the correct number of threads. It should be 1 thread per scheduled task. If the kafka emitter was emitting every eventType the lost event logging callable would never get called.
This change intelligently provisions the correct number of threads per scheduled task. 1 for each event type, and 1 for logging the lost events. This is a change to make this work. But in the future it would be worthwhile to make each task not be greedy and share threads so there isn't a need of a thread per task.
Release note
Fixed: KafkaEmitter will now run all scheduled callables. It now intelligently provision threads to make sure there are no wasted threads, and all callables can run.
Key changed/added classes in this PR
KafkaEmitterKafkaEmitterConfigThis PR has: