-
Notifications
You must be signed in to change notification settings - Fork 0
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: SIGNAL-7090 UPDATE async worker id setting per partition #97
Merged
seungjinstord
merged 6 commits into
main
from
SIGNAL-7090-async-adapter-to-start-partition-based-async-worker
Sep 23, 2024
Merged
fix: SIGNAL-7090 UPDATE async worker id setting per partition #97
seungjinstord
merged 6 commits into
main
from
SIGNAL-7090-async-adapter-to-start-partition-based-async-worker
Sep 23, 2024
Conversation
This file contains 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
btkostner
requested changes
Sep 23, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice find!
…ode setup for partitioned messages
btkostner
approved these changes
Sep 23, 2024
seungjinstord
deleted the
SIGNAL-7090-async-adapter-to-start-partition-based-async-worker
branch
September 23, 2024 22:26
seungjinstord
pushed a commit
that referenced
this pull request
Sep 23, 2024
An automated release has been created for you. --- ## [3.1.1](v3.1.0...v3.1.1) (2024-09-23) ### Bug Fixes * SIGNAL-7090 UPDATE async worker id setting per partition ([#97](#97)) ([060dbd7](060dbd7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
Related Ticket(s)
SIGNAL-7090
Checklist
Problem
While trying to use the BroadwayAdapter, I found that something in the AsyncAdapter was pushing the messages to just one partition.
Details
I was able to trace it back to the
get_or_create_worker
function. I found out that unless the:id
is customized, and justAsyncWorker
is used, then it doesn't matter whichever distinct name is used for Registry - the same worker pid is going be to tried to be retrieved. This means even though a different partition is found from AsyncAdapter, when it comes to get the associated worker pid - the first one created will be returned for any subsequent worker retrieval attempt.Downstream effect is the consuming phase gets slowed down - only one partition will have all of the messages for the consumer group. Meaning, no matter how many consumers you have in the consumer group - only one consumer will be handling all of the messages pushed into the topic, across all of the partitions.
The fix is using a custom id that appends the partition number to the atom
AsyncWorker
. I string-concatenated it and didn't explicitly change it to atom, but I suspect it would be done under the hood.As to why this was not detected in production, is probably because of the robustness of BEAM - a self-healing of crashed supervisor tree would end up picking random workers to be created, resulting in distributing messages across partitions.
But because for firehose we're passing a lot more messages, this became more visible.
TL;DR - I think this would increase overall performance of production consumption of Kafka messages for anywhere using AsyncAdapter. Meaning, this would increase consumption performance of services that consume from topic
wms-service
, which are GAS and WMS Bridge.