+
+ if (!sealAndSend(Optional.absent())) {
+ sealSuccessor();
+ }
+ }
+
+ /**
+ * Internal seal propagation method, invoked when we have raced with reconnection thread. Note that there may have
+ * been multiple reconnects, so we have to make sure the action is propagate through all intermediate instances.
+ */
+ private void sealSuccessor() {
+ // Slow path: wait for the successor to complete
+ final AbstractProxyTransaction successor = awaitSuccessor();
+
+ // At this point the successor has completed transition and is possibly visible by the user thread, which is
+ // still stuck here. The successor has not seen final part of our state, nor the fact it is sealed.
+ // Propagate state and seal the successor.
+ final java.util.Optional<ModifyTransactionRequest> optState = flushState();
+ if (optState.isPresent()) {
+ forwardToSuccessor(successor, optState.get(), null);
+ }
+ successor.predecessorSealed();