Skip to content

SAMZA-2277: Semantics for cluster-manager.container.retry.window.ms not reflected in code - #1108

Closed
dnishimura wants to merge 5 commits into
apache:masterfrom
dnishimura:samza-2277-cluster-manager-retry-window-bug-fix
Closed

dnishimura wants to merge 5 commits into
apache:masterfrom
dnishimura:samza-2277-cluster-manager-retry-window-bug-fix

Conversation

@dnishimura

Copy link
Copy Markdown
Contributor

In the current code, the window is only applied and checked on the last retry. However, the check should be done at all retries.

This was found during #1104

@rmatharu please take a look

* If there are too many failed container failures (configured by job.container.retry.count) for a
* processor, the job exits.
*/
volatile boolean tooManyFailedContainers = false;

@rmatharu-zz rmatharu-zz Jul 22, 2019 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be better to expose a getter instead, for unit-testing than make package private?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will change.

processorFailures.put(processorId, new ProcessorFailure(1, System.currentTimeMillis()));
}

long lastFailureMsDiff = Instant.now().toEpochMilli() - lastFailureTime;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor: Might be preferable to set lastFailureMsDiff in the if-condition above, to avoid time-skew in measurements.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I imagine it would be a sub-millisecond skew? Would that matter? Will change anyways to make the code cleaner.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Typically, yes. In some cases, CPU preemption can cause the time to be relatively large, i've only seen it once when the host was so busy it was spending most of the time context-switching

@rmatharu-zz rmatharu-zz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for this fix. Couple of minor things.

@dnishimura dnishimura left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@rmatharu addressed your comments. Please merge to master after you approve the latest changes.

processorFailures.put(processorId, new ProcessorFailure(1, System.currentTimeMillis()));
}

long lastFailureMsDiff = Instant.now().toEpochMilli() - lastFailureTime;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I imagine it would be a sub-millisecond skew? Would that matter? Will change anyways to make the code cleaner.

* If there are too many failed container failures (configured by job.container.retry.count) for a
* processor, the job exits.
*/
volatile boolean tooManyFailedContainers = false;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will change.

@dnishimura

Copy link
Copy Markdown
Contributor Author

@rmatharu I addressed your minor comments. Please merge if you don't have any more comments. Thanks!

* If there are too many failed container failures (configured by job.container.retry.count) for a
* processor, the job exits.
*/
volatile boolean tooManyFailedContainers = false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we update the comment to "If there are more than job.container.retry.count failures of a container within a job.container.retry.window period, the CPM exits"?
and update the flag to jobFailureCriteriaMet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion, it makes it clearer. Will change.

taskManager.stop();
}

@Test

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/** Test scenario where a container fails multiple times but failures are more than retryWindow apart.*/

@rmatharu-zz rmatharu-zz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the changes.
Left couple of minor comments.
Feel free to checkin

@dnishimura

Copy link
Copy Markdown
Contributor Author

@rmatharu I made your suggested changes. I'm not a committer so I can't check in the changes. Please merge this PR when you get a chance. Thanks!

@asfgit asfgit closed this in cf0ecea Jul 29, 2019
dnishimura added a commit to dnishimura/samza that referenced this pull request Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants