Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-93489

Avoid scheduling work to handle dismissed CancellationSources

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: