-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[improve][broker] Added synchronized for sendMessages in Non-Persistent message dispatchers #24386
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
Conversation
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.
LGTM
Thanks for fixing this issue @sandeep-mst |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #24386 +/- ##
============================================
+ Coverage 73.57% 74.24% +0.67%
+ Complexity 32624 32298 -326
============================================
Files 1877 1867 -10
Lines 139502 145267 +5765
Branches 15299 16610 +1311
============================================
+ Hits 102638 107855 +5217
+ Misses 28908 28870 -38
- Partials 7956 8542 +586
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…nt message dispatchers (apache#24386) (cherry picked from commit cb0fe5b) (cherry picked from commit 7ed6edc)
…nt message dispatchers (apache#24386) (cherry picked from commit cb0fe5b) (cherry picked from commit 31bae69)
…nt message dispatchers (apache#24386) (cherry picked from commit cb0fe5b) (cherry picked from commit 7ed6edc)
…nt message dispatchers (apache#24386) (cherry picked from commit cb0fe5b) (cherry picked from commit 7ed6edc)
…nt message dispatchers (apache#24386) (cherry picked from commit cb0fe5b) (cherry picked from commit 31bae69)
…nt message dispatchers (apache#24386) (cherry picked from commit cb0fe5b) (cherry picked from commit 7ed6edc)
…nt message dispatchers (apache#24386) (cherry picked from commit cb0fe5b) (cherry picked from commit 31bae69)
…nt message dispatchers (apache#24386) (cherry picked from commit cb0fe5b)
Fixes #24379
Motivation
We have observed inconsistency with the usage of
synchronized
keyword while dispatching messages to the consumer across different dispatchers.The following are not using
synchronized
keyword while filtering and sending messages to the consumers.The rest of the dispatchers including all the persistent dispatchers and NonPersistentDispatcherMultipleConsumers use synchronized while sending messages. This causes inconsistencies across different dispatchers while running server-side filters with multiple producers and a single consumer as it will get multi-threaded. This is even more a case when server-side filter code is not thread-safe.
Modifications
Added synchronized keyword at the following two method calls.
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository:
cognitree#24