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

[8.x] Release concurrency lock for errors #35546

Merged
merged 3 commits into from
Dec 9, 2020

Conversation

esbenp
Copy link
Contributor

@esbenp esbenp commented Dec 9, 2020

Currently the concurrency limiter will only release the lock if an exception is thrown in the block request. This PR will catch Throwable instead to release the lock when an Error occurs

@mfn
Copy link
Contributor

mfn commented Dec 9, 2020

Interesting. Maybe the code should be changed to not use tap but just release in a finally block? 🤔

Untested:

try {
  $callback();
} finally {
  $this->release($slot, $id);
}

@driesvints driesvints changed the title release concurrency lock for errors [8.x] Release concurrency lock for errors Dec 9, 2020
@taylorotwell taylorotwell merged commit 597d101 into laravel:8.x Dec 9, 2020
@esbenp esbenp deleted the concurrency-throwable branch December 9, 2020 14:04
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