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 SemaphoreFullException from incorrect use of SemaphoreSlim #2803

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

pmachapman
Copy link
Collaborator

@pmachapman pmachapman commented Oct 14, 2024

This PR fixes SemaphoreFullException crashes that have been occurring on sync, due ReleaseAsync() being called before WaitAsync() had completed. This can happen if the token is cancelled.

The solution to this is to follow the correct design pattern by having WaitAsync() called before try/catch block.

This PR does not require testing, as the only confirmation necessary is that a sync is successful.


This change is Reviewable

Copy link
Collaborator

@Nateowami Nateowami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @pmachapman)

@Nateowami Nateowami enabled auto-merge (squash) October 14, 2024 19:53
@Nateowami Nateowami merged commit 66d437d into master Oct 14, 2024
13 checks passed
@Nateowami Nateowami deleted the fix/semaphore-usage branch October 14, 2024 20:00
Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.02%. Comparing base (5617ebd) to head (800baec).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2803   +/-   ##
=======================================
  Coverage   79.02%   79.02%           
=======================================
  Files         530      530           
  Lines       30719    30719           
  Branches     5021     5022    +1     
=======================================
  Hits        24276    24276           
- Misses       5661     5673   +12     
+ Partials      782      770   -12     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants