Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4287,13 +4287,17 @@ private void restartSession(boolean wait)
final long wakes;
synchronized (serviceStateLock)
{
if (sessionHasAnOwner())
/*
* The domain is going away or is being imported into: the session is not this
* thread's to stop. The total update is claimed against rather than read (issue
* #1041): the listener thread claims one this replica did not ask for under no lock,
* and a read here a few statements before that claim would stop the session the
* import is about to read.
*/
if (ownsItsSession() || !disableServiceUnlessImportInProgress())
{
// The domain is going away or is being imported into: the session is not this
// thread's to stop.
return;
}
disableService();
stoppedSession = getSessionGeneration();
wakes = sessionRestartBackoffWakes();
}
Expand Down Expand Up @@ -6213,6 +6217,11 @@ private boolean ownsItsSession()
* it carries: the domain itself, when it is shutting down or disabled
* ({@link #ownsItsSession()}), or a total update into this replica.
* <p>
* What this reads, {@link #restartSession(boolean)} claims: a total update the listener
* thread is about to claim is not visible to a read, and the restart must not stop the
* session such a total update reads (issue #1041). This is the early exit of the roads
* which lead to that restart, and the answer for the ones which never restart anything.
* <p>
* The total update owns the session from the moment it is asked for, not from the
* moment its entries stream: the {@code InitializeTargetMsg} which answers the request
* arrives over that session, so a restart made while it is on its way loses it, and the
Expand Down
Loading
Loading