Tunnel requested abort exception to semaphore wait caller #2601
+133
−25
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.
Today, when calling
wait(abort_source&)
the caller always getssemaphore_aborted
error when abort is requested.However, with
abort_on_expiry
, the actual reason could be timeout expiry, which should be distinguishable from the abort error.This series modifies
abort_on_expiry
first to request abort with atimed_out_error
exception, and theninternal::abortable_fifo
andsemaphore
are changed to tunnel that exception to the caller.Respective unit tests were added to test those cases.
The motivation for this change is scylladb/scylladb#22017
which will use scylladb utils::composite_abort_source to compose an
abort_on_expiry
abort_source, used for point request timeout and a global abort_source used on shutdown.