-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Server Programmability
CancellationToken::onCancel returns a SemiFuture, which means any callbacks attached to it must run on some other executor unless unsafeToInlineFuture is used. For CancellationTokens, this may incur unneeded scheduling overhead, since most CancellationTokens are never actually cancelled, but work needs to be scheduled to handle the non-cancellation (i.e. dismissal), usually by just returning.
We should consider ways to avoid this overhead, e.g. by not fulfilling the cancellation futures when the CancellationSource is dismissed, and instead just destructing them.
- is related to
-
SERVER-95571 Reduce overhead of non-future returning ExecutorFuture continuations
- Backlog