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

When queue is full, requests hang because Wait.Done() is not called on the affected notification #430

Merged
merged 2 commits into from
Oct 16, 2019

Conversation

SebastienMelki
Copy link
Contributor

While testing a few scenarios I noticed that whenever tryEnqueue fails on a notification due to the queue not being available then the request will block on wg.Wait() in Sync mode which will lead the request to hang.
My proposed fix returns the failed notifications to the client so that it can act accordingly

@codecov-io
Copy link

codecov-io commented Oct 12, 2019

Codecov Report

Merging #430 into master will decrease coverage by 0.31%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #430      +/-   ##
==========================================
- Coverage   83.97%   83.66%   -0.32%     
==========================================
  Files          19       19              
  Lines        1348     1353       +5     
==========================================
  Hits         1132     1132              
- Misses        173      178       +5     
  Partials       43       43
Impacted Files Coverage Δ
gorush/worker.go 87.27% <0%> (-8.73%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 38f7986...a1ad1c3. Read the comment docs.

@SebastienMelki
Copy link
Contributor Author

@appleboy I believe this fixes this issue #422

@appleboy appleboy merged commit 7ddc7ed into appleboy:master Oct 16, 2019
appleboy pushed a commit that referenced this pull request Oct 17, 2019
* if queue is full then mark notification as failed and unblock the wait group instead of hanging

* use WaitDone() function instead of calling Done() on notification wait group as it is safer
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.

3 participants