[SERVER-35679] General Interruption Facility Created: 19/Jun/18  Updated: 08/Jan/24  Resolved: 17/Sep/18

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.1.4

Type: New Feature Priority: Major - P3
Reporter: Mira Carey Assignee: Mira Carey
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-21005 Consistent maxTimeMs / timeout / inte... Closed
is duplicated by SERVER-23625 Some read-only operations (eg count,a... Closed
Related
Backwards Compatibility: Fully Compatible
Sprint: Platforms 2018-07-16, Platforms 2018-07-30, Platforms 2018-08-13, Platforms 2018-09-24
Participants:
Linked BF Score: 27

 Description   

Add support for a generalized interruptibility facility in the server.

This offers a generalized interruptibility facility, trialed inFuture<T> and ProducerConsumerQueue<T>.

It offers 3 major concepts:

Notifyable: A type which can notified off-thread, causing a wake up from some kind of blocking wait

Waitable: A type which is Notifyable, and also can perform work while in a ready-to-receive notification state. static methods offer support for running underneath condition_variable::wait's. The chief implementer is the transport layer baton type

Interruptible: A type which can wait on condition variables, and offers:

  • deadlines. This means the type integrates some sort of clock source
  • interruptibility. This means the type offers a way of noticing that it should no longer run via status or exception

Additionally, Interruptible's offer special scoped guards which offer

  • Exemption from interruption in a region defined by the lifetime of a guard object
  • Subsidiary deadlines which can trigger recursively, offering specialized timeout and status return support.

The series of virtual types allows us to slice the interface between opCtx and future such that opctx can use future and future can use opctx. Additionally, cutting out more functionality allows us to flow a noop interruptibility type which unifies our waiting behind a common api.



 Comments   
Comment by Githook User [ 18/Sep/18 ]

Author:

{'name': 'Jason Carey', 'email': 'jcarey@argv.me', 'username': 'hanumantmk'}

Message: SERVER-35679 Fix unused named exception

in operation_context_test
Branch: master
https://github.com/mongodb/mongo/commit/cd441ed71c1453993b3af4617e704fbbad3783ef

Comment by Githook User [ 17/Sep/18 ]

Author:

{'name': 'Jason Carey', 'email': 'jcarey@argv.me', 'username': 'hanumantmk'}

Message: SERVER-35679 General Interruption Facility

Add support for a generalized interruptibility facility in the server.

This offers a generalized interruptibility facility, trialed in
Future<T> and ProducerConsumerQueue<T>.

It offers 3 major concepts:

Notifyable: A type which can notified off-thread, causing a wake up
from some kind of blocking wait

Waitable: A type which is Notifyable, and also can perform work while in
a ready-to-receive notification state. static methods offer support for
running underneath condition_variable::wait's. The chief implementer is
the transport layer baton type

Interruptible: A type which can wait on condition variables, and offers:

  • deadlines. This means the type integrates some sort of clock source
  • interruptibility. This means the type offers a way of noticing
    that it should no longer run via status or exception

Additionally, Interruptible's offer special scoped guards which
offer

  • Exemption from interruption in a region defined by the lifetime
    of a guard object
  • Subsidiary deadlines which can trigger recursively, offering
    specialized timeout and status return support.

The series of virtual types allows us to slice the interface between
opCtx and future such that opctx can use future and future can use
opctx. Additionally, cutting out more functionality allows us to flow a
noop interruptibility type which unifies our waiting behind a common
api.
Branch: master
https://github.com/mongodb/mongo/commit/6e3c5ea176aadbd0475f8f87525b9f0fabd4bdc9

Generated at Thu Feb 08 04:40:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.