Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
badrishc committed Aug 14, 2019
1 parent 572b8bd commit 4b75494
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cs/src/core/ClientSession/FASTERAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ internal async ValueTask CompleteCheckpointAsync(ClientSession<Key, Value, Input
// So we need to constantly complete pending
// and refresh (done inside CompletePending)
// for the checkpoint to be proceed
int count = 0;
do
{
await InternalRefreshAsync(clientSession);
Expand All @@ -99,6 +100,8 @@ internal async ValueTask CompleteCheckpointAsync(ClientSession<Key, Value, Input
clientSession.ResumeThread();
return;
}

if (count++ == 10000) throw new Exception("CompleteCheckpointAsync loop too long");
} while (true);
}

Expand Down Expand Up @@ -145,8 +148,14 @@ private async ValueTask HandleCheckpointingPhasesAsync(ClientSession<Key, Value,
var previousState = SystemState.Make(threadCtx.Value.phase, threadCtx.Value.version);
var finalState = SystemState.Copy(ref _systemState);

int count = 0;
while (finalState.phase == Phase.INTERMEDIATE)
{
finalState = SystemState.Copy(ref _systemState);
if (count++ == 10000) throw new Exception("Intermediate too long");
}

count = 0;

// We need to move from previousState to finalState one step at a time
do
Expand Down Expand Up @@ -351,6 +360,7 @@ private async ValueTask HandleCheckpointingPhasesAsync(ClientSession<Key, Value,
threadCtx.Value.version = currentState.version;

previousState.word = currentState.word;
if (count++ == 10000) throw new Exception("HandleCheckpointingPhases do loop too long " + previousState + ":" + finalState);
} while (previousState.word != finalState.word);
}
}
Expand Down

0 comments on commit 4b75494

Please sign in to comment.