-
Notifications
You must be signed in to change notification settings - Fork 206
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
feat: support cancellation safe future #1071
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tanruixiang
reviewed
Jul 12, 2023
Co-authored-by: Ruixiang Tan <819464715@qq.com>
ShiKaiWi
force-pushed
the
feat-future-cancel-guard
branch
from
July 14, 2023 03:36
f66768f
to
6a6276b
Compare
ShiKaiWi
changed the title
feat: support future cancel detection
feat: support cancellation safe future
Jul 14, 2023
Rachelint
approved these changes
Jul 14, 2023
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.
LGTM
ShiKaiWi
force-pushed
the
feat-future-cancel-guard
branch
from
July 14, 2023 06:34
6a6276b
to
4fba378
Compare
jiacai2050
pushed a commit
that referenced
this pull request
Jul 17, 2023
## Rationale If the first write request is canceled, the write request in the queue will never be executed, until the queue is full, then an error will be returned. ## Detailed Changes Use `CancellationSafeFuture` to execute the write requests, see #1071 ## Test Plan Existing tests.
MichaelLeeHZ
pushed a commit
to MichaelLeeHZ/ceresdb
that referenced
this pull request
Jul 18, 2023
In some case, the future cancel safety must be guaranteed, but there is no such a mechanism to make it now. Introduce `CancellationSafeFuture` to wrap a future to ensure it must be executed. New unit tests. This implementation refers to: https://github.com/influxdata/influxdb_iox/blob/885767aa0a6010de592bde9992945b01389eb994/cache_system/src/cancellation_safe_future.rs --------- Co-authored-by: Ruixiang Tan <819464715@qq.com>
MichaelLeeHZ
pushed a commit
to MichaelLeeHZ/ceresdb
that referenced
this pull request
Jul 18, 2023
## Rationale If the first write request is canceled, the write request in the queue will never be executed, until the queue is full, then an error will be returned. ## Detailed Changes Use `CancellationSafeFuture` to execute the write requests, see apache#1071 ## Test Plan Existing tests.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale
In some case, the future cancel safety must be guaranteed, but there is no such a mechanism to make it now.
Detailed Changes
Introduce
CancellationSafeFuture
to wrap a future to ensure it must be executed.Test Plan
New unit tests.
Additional
This implementation refers to: https://github.com/influxdata/influxdb_iox/blob/885767aa0a6010de592bde9992945b01389eb994/cache_system/src/cancellation_safe_future.rs