Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

catch potential runtime exceptions during recovery

  • Loading branch information...
commit 96f9d9351c280ff3f1414016e60b4d2662152d1d 1 parent c690cb8
Matthieu Morel authored
Showing with 12 additions and 3 deletions.
  1. +12 −3 s4-core/src/main/java/io/s4/processor/AbstractPE.java
View
15 s4-core/src/main/java/io/s4/processor/AbstractPE.java
@@ -544,12 +544,21 @@ private void saveState(SafeKeeperId key, byte[] serializedState) {
}
protected void recover() {
- byte[] serializedState = safeKeeper.fetchSerializedState(getSafeKeeperId());
+ byte[] serializedState = null;
+ try {
+ serializedState = safeKeeper.fetchSerializedState(getSafeKeeperId());
+ } catch (RuntimeException e) {
+ Logger.getLogger("s4-ft").error("Cannot fetch serialized stated for key [" + getSafeKeeperId().toString()+"]: "+e.getMessage(), e);
+ }
if (serializedState == null) {
return;
}
- AbstractPE peInOldState = deserializeState(serializedState);
- restoreState(peInOldState);
+ try {
+ AbstractPE peInOldState = deserializeState(serializedState);
+ restoreState(peInOldState);
+ } catch (RuntimeException e) {
+ Logger.getLogger("s4-ft").error("Cannot restore state for key [" + getSafeKeeperId().toString()+"]: "+e.getMessage(), e);
+ }
}
public SafeKeeperId getSafeKeeperId() {
Please sign in to comment.
Something went wrong with that request. Please try again.