Skip to content

Commit

Permalink
Correctly locked the snapshot on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphfrk committed Aug 2, 2012
1 parent 575a30f commit a3ce848
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/spout/engine/scheduler/SpoutScheduler.java
Expand Up @@ -233,6 +233,7 @@ public void run() {
Spout.getLogger().log(Level.SEVERE, "Interrupt while running final snapshot copy: {0}", ex.getMessage()); Spout.getLogger().log(Level.SEVERE, "Interrupt while running final snapshot copy: {0}", ex.getMessage());
} }


TickStage.setStage(TickStage.TICKSTART);
runLastTickTasks(); runLastTickTasks();


asyncExecutors.copySnapshot(); asyncExecutors.copySnapshot();
Expand All @@ -255,7 +256,7 @@ public void run() {
} }


try { try {
copySnapshot(asyncExecutors.get()); copySnapshotWithLock(asyncExecutors.get());
} catch (InterruptedException ex) { } catch (InterruptedException ex) {
Spout.getLogger().log(Level.SEVERE, "Error while halting all executors: {0}", ex.getMessage()); Spout.getLogger().log(Level.SEVERE, "Error while halting all executors: {0}", ex.getMessage());
} }
Expand All @@ -274,7 +275,7 @@ public void run() {
} }


try { try {
copySnapshot(asyncExecutors.get()); copySnapshotWithLock(asyncExecutors.get());
} catch (InterruptedException ex) { } catch (InterruptedException ex) {
engine.getLogger().log(Level.SEVERE, "Error while shutting down engine: {0}", ex.getMessage()); engine.getLogger().log(Level.SEVERE, "Error while shutting down engine: {0}", ex.getMessage());
} }
Expand Down

0 comments on commit a3ce848

Please sign in to comment.