Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Don't mark world state as stalled until a minimum time without progress is reached #1179

Merged
merged 5 commits into from
Mar 31, 2019

Conversation

ajsutton
Copy link
Contributor

PR description

Delays marking a world state download as stalled until at least 5 minutes has passed since the last progress was made. This is in addition to requiring a minimum number of requests without progress.

Additionally increases the minimum number of requests without progress from 100 to 1000. Since restarting the world state download is expensive it's worth having high thresholds before giving up.

Copy link
Contributor

@mbaxter mbaxter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending response to the test comments

@@ -131,6 +136,18 @@ public void shouldResetRequestsSinceProgressCountWhenProgressIsMade() {
assertThat(downloadState.getDownloadFuture()).isCompletedExceptionally();
}

@Test
public void shouldNotBeStalledWhenMaxRequestsReachedButNotMinimumTime() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public void shouldNotBeStalledWhenMaxRequestsReachedButNotMinimumTime() {
public void shouldStallWhenMaxRequestsReachedAndTimeLimitExceeded() {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this test is checking for stalling? Worth adding the tests for the 2 other cases where it doesn't stall though (T/F and F/T for timeLimitHit/failedRequestsLimitHit).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test hits the maximum requests without progress limit and checks the download isn't considered stalled until the minimum time condition is also met. Tidied up the test name and implementation to make this clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensured the other combinations of time/requests reached/not-reached were covered.


clock.stepMillis(MIN_MILLIS_BEFORE_STALLING + 1);
downloadState.requestComplete(false);
assertThat(downloadState.getDownloadFuture()).isCompletedExceptionally();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably worth checking the exception here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

downloadState.requestComplete(false);
assertThat(downloadState.getDownloadFuture()).isCompletedExceptionally();
}

@Test
public void shouldNotAddRequestsAfterDownloadIsStalled() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public void shouldNotAddRequestsAfterDownloadIsStalled() {
public void shouldNotAddRequestsAfterDownloadIsCompleted() {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ajsutton ajsutton merged commit 19d1668 into PegaSysEng:master Mar 31, 2019
@ajsutton ajsutton deleted the stall-timer branch March 31, 2019 21:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants