-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Avoid timeouts for cancelling command #325
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
Conversation
|
Coverage increased (+0.3%) to 93.178% when pulling a8e2219df03ed7efe3563d694426fc8ffc95a93f on jongyeol:feature/add-latch-for-cancel into 92cd88b on mp911de:master. |
|
Thanks for your pull request. Lettuce uses/relies currently on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latch should be released after invoking cancellation to avoid a state in which the latch is released but the Future is not canceled yet. I think wrapping the two cancel calls into a try and releasing the latch in finally should do the job.
|
@mp911de , I agreed about it. then, I'll update this soon. :) |
|
No need to rush. I'm traveling this week, won't be able to do much. |
a8e2219 to
b635f76
Compare
|
I don't want to disturb your travel. Please check it after your travel~ |
Lettuce now releases the wait latch for async/future command execution if the command get canceled. Releasing the wait latch reduces the wait time and provides an eager feedback.
|
Thanks for the PR. That's merged with ee3a2f7. |
Make sure that:
You have read the contribution guidelines.
You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
You submit test cases (unit or integration tests) that back your changes.
When an
AsyncCommandwas cancelled in another thread,LettuceFutures#awaitOrCancel()waited for long time and a timeout exception occured. So, I updatedAsyncCommand#cancel()method usinglatch#countDown(), it'll occured an cancelled exception directly without meaningless waiting.Previously: