made sure that finish to execute a transaction while the server is shutting down
@@ -63,10 +63,21 @@ public class ONewDistributedResponseManager implements ODistributedResponseManag
@Override
public synchronized boolean waitForSynchronousResponses() throws InterruptedException {
+ boolean interrupted = false;
+ while (true) {
+ try {
if (!quorumReached) {
wait(timeout);
}
+ if (interrupted) {
+ Thread.currentThread().interrupt();
+ }
return quorumReached;
+ } catch (InterruptedException e) {
+ //Let the operation finish anyway
+ interrupted = true;
+ }
+ }
}
@Override
@@ -210,7 +221,6 @@ public class ONewDistributedResponseManager implements ODistributedResponseManag
return finished;
}
-
@Override
public void timeout() {
