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

Fix rep cancellation #143

Merged
merged 2 commits into from
Sep 14, 2023
Merged

Fix rep cancellation #143

merged 2 commits into from
Sep 14, 2023

Conversation

encse
Copy link
Contributor

@encse encse commented Aug 25, 2023

I have found a race condition in the ctx cancellation in repWriter.

Added a test which reproduces the issue with a possible fix.

I don't quite understand why dont we use ctx in the write routine, see my second commit about that.

… Msg):

if the run() loop of repWriter has exited because r.ctx was cancelled then <- repSendPayload will block, because nobody is reading the channel anymore

I'm adding a test that reproduces the issue with a fix.
@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Patch coverage: 71.42% and project coverage change: -0.22% ⚠️

Comparison is base (bd7e871) 67.63% compared to head (099cec7) 67.42%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #143      +/-   ##
==========================================
- Coverage   67.63%   67.42%   -0.22%     
==========================================
  Files          29       29              
  Lines        2555     2560       +5     
==========================================
- Hits         1728     1726       -2     
- Misses        724      730       +6     
- Partials      103      104       +1     
Files Changed Coverage Δ
rep.go 69.43% <71.42%> (-0.26%) ⬇️

... and 2 files with indirect coverage changes

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

@sbinet
Copy link
Contributor

sbinet commented Sep 13, 2023

(apologies for the belated answer: holidays and the backlog from work...)

thanks for the PR.

could you send another PR against https://github.com/go-zeromq/license adding yourself to the AUTHORS and/or CONTRIBUTORS files ?
(then I'll merge that one. it will take less than a month from side :P)

@encse
Copy link
Contributor Author

encse commented Sep 14, 2023

Hey, thanks for your time. I added myself in this PR: go-zeromq/license#16

@sbinet
Copy link
Contributor

sbinet commented Sep 14, 2023

needs go-zeromq/license#16

@sbinet sbinet merged commit 683c549 into go-zeromq:main Sep 14, 2023
2 of 3 checks passed
@sbinet
Copy link
Contributor

sbinet commented Sep 14, 2023

thanks a lot.

@encse encse deleted the fix-rep-cancellation branch September 14, 2023 18:00
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.

2 participants