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

Added lock for message.Router.middlewares #465

Merged
merged 2 commits into from
Aug 23, 2024
Merged

Conversation

SargtLa
Copy link
Contributor

@SargtLa SargtLa commented Aug 8, 2024

I have faced the race condition here when I was adding a handler with handler middleware while some concurrent process was calling RunHandlers. It is specified that RunHandlers is idempotent and there are locks for handlers, but not for middlewares.

Fixes #466

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.96%. Comparing base (57df621) to head (ff2cdd4).
Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #465      +/-   ##
==========================================
+ Coverage   66.88%   66.96%   +0.07%     
==========================================
  Files          64       64              
  Lines        4282     4289       +7     
==========================================
+ Hits         2864     2872       +8     
  Misses       1242     1242              
+ Partials      176      175       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@m110
Copy link
Member

m110 commented Aug 23, 2024

Thanks @SargtLa!

@m110 m110 merged commit b7676e5 into ThreeDotsLabs:master Aug 23, 2024
11 checks passed
thejoeejoee pushed a commit to thejoeejoee/watermill that referenced this pull request Sep 5, 2024
Co-authored-by: Lara Blyshchyk <[email protected]>
Co-authored-by: Miłosz Smółka <[email protected]>
exasyvetde pushed a commit to exasyvetde/watermill that referenced this pull request Sep 10, 2024
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 this pull request may close these issues.

Race condition on adding handler specific middlewares
2 participants