| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Postpone destruction of opCtx until after responding to clients to
reduce the cost of destroying opCtx on the critical execution path.
|
|
|
|
| |
on condvars
|
|
|
|
| |
OperationContext::waitForConditionOrInterrupt()
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The OperationContext class accepts an ErrorCodes::Error for markKilled()
and deadline-setting methods. This error code may be converted to a
Status object on checkForInterruptNoAssert() or
waitForConditionOrInterruptNoAssertUntil() call. When the error code is
one that is associated with an ErrorExtraInfo object, Status
construction will fail as we expect Status construction to either
include a subclass of ErrorExtraInfo or a BSONObj from which it can be
serialized.
Until a use case comes up, add an invariant to prevent passing an error
code with extra info
|
|
|
|
|
|
|
|
|
|
|
|
| |
* rename opCtx->runWithoutInterruption to
runWithoutInterruptionExceptAtGlobalShutdown
* add a opCtx->setIsExecutingShutdown method which makes the op immune
to all forms of interruption, including global shutdown
This clarifies what opCtx->runWithoutInterruption actually did and
offers an escape hatch that turns off interruption at process exit for
the thread doing cleanup.
|
|
|
|
|
|
| |
Remove leading comments that are just stating the filename.
Move any file-level comments below the copyright banner.
Remove leading blank lines.
|
| |
|
|
|
|
|
|
|
|
|
| |
This patch converts the existing transactions diagnostics timing related
metrics to use a TickSource to record transaction durations. The
TickSource is a high precision, mock-able time source for measuring
the passage of time. This patch also converts the existing unit tests
to use a mock TickSource, which allows the tests to fully virtualize
time, making them much faster and less flaky.
|
|
|
|
| |
in operation_context_test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Adds a new 'MaxTimeMSExpired' error code, returned when a timeout occurs
due to exceeding of maxTimeMS. Timeouts unrelated to maxTimeMS will
continue to return 'ExceededTimeLimit'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
every unit test.
This patch does several loosely related and surprisingly hard to separate things.
1.) Make the ServiceContext class final
2.) Create a mechanism, called ConstructorActions, for running methods on
ServiceContexts immediately after they're built and immediately before they're
destroyed.
3.) Introduce / improve test fixture base classes for tests, giving them fresh
ServiceContext instances for each test case. There is one fixture for tests that
need a storage engine and another for those that do not.
4.) Make several remaining global variables SC decorations in support of (3)
5.) Replace many MONGO_INITIALIZERS that access getGlobalServiceContext with the
new constructor-actions system, which is needed for (3.)
6.) Fix up tests to use the fixtures from (3) and fix tests that silently used
different service contexts in together in a technically illegal fashion that now
breaks.
7.) Utilize (2) as necessary to simplify initialization of new ServiceContexts,
simplifying the fixtures in (3).
|
| |
|
|
|
|
| |
update ShardServerCatalogCacheLoader accordingly
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Inclusion of a sha256 digest of the full username to the logical session
id (in addition to the current guid) is necessary to fully disambiguate
logical sessions in degraded clusters (when the authoritative record for
a session is unreachable).
Semantics for the uid are as follows:
session creation via startSession()
* Sessions can only be created with one, and only one, user authenticated
* The composite key is created from a guid created on the spot, as well
as the digest of the currently auth'd username
* Only the session guid is returned to the user
* This prevents outside users from attempting to send back a value
we'd have to check. It's preferable to decorate the guid with the
user digest per command, rather than having to check a value the user
might send.
session use for a command
* Sessions are passed via the lsid top level field in any command
* Sessions are only meaningful for commands which requireAuth. For
sessions which don't require auth, we strip session information from the
command at parse time
* Session ids are passed as an object, which can optionally include the
username digest
* It is illegal to pass the username digest unless the currently
auth'd user has the impersonate privilege (the __system user does).
This enables sessions on shard servers via mongos
|
| |
|
|
|
|
| |
OperationContext
|
|
|
|
| |
LogicalSessionId
|
|
|
|
|
|
|
|
|
|
| |
operation_context_test.
Since OperationContext::sleepFor is a thin wrapper around the predicate form of
OperationContext::waitForConditionOrInterrupt, the SleepForExpires test duplicates
coverage from the SleepUntilExpires and ForExpiresWhileWaiting tests. It is also
racy, because it must sleep on a different condition variable from the one supplied
in the WaitTestState.
|
|
|
|
|
|
| |
This patch makes the return types of predicated waits on condition variables
and Notification::waitFor look more like the corresponding functions in C++
standard types.
|
|
|
|
| |
OperationContext.
|
|
|
|
|
|
| |
This commit is an automated rename of all whole word instances of txn,
_txn, and txnPtr to opCtx, _opCtx, and opCtxPtr, respectively in all
.cpp and .h files in src/mongo.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
OperationContext.
This completes the mechanics of moving max-time tracking to OperationContext and
switching the checkForInterrupt checks to use the service context's fast clock
source, while tracking the amount of execution time remaining on a cursor with
microsecond granularity to ensure that remaining execution time always declines,
even for very brief operations on cursors.
This patch does not complete the transition from wait_for waiting to wait_until
waiting in all places that do waiting based on operation deadlines.
|
|
This also unifies the implementations of checkForInterrupt and checkForInterruptNoAssert.
|