Skip to content

Fix for negative durations #1252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 30, 2016
Merged

Fix for negative durations #1252

merged 2 commits into from
Aug 30, 2016

Conversation

ssalinas
Copy link
Member

A few of these have been reported now. There is no reason Singularity should be crashing for this. Make sure the values are non-negative in these two cases.
/fixes #1174 #1251

@@ -149,7 +149,7 @@ private void checkDeploy(final SingularityPendingDeploy pendingDeploy, final Lis
SingularityDeployResult deployResult =
getDeployResult(request, cancelRequest, pendingDeploy, updatePendingDeployRequest, deployKey, deploy, deployMatchingTasks, allOtherMatchingTasks, inactiveDeployMatchingTasks);

LOG.info("Deploy {} had result {} after {}", pendingDeployMarker, deployResult, JavaUtils.durationFromMillis(System.currentTimeMillis() - pendingDeployMarker.getTimestamp()));
LOG.info("Deploy {} had result {} after {}", pendingDeployMarker, deployResult, JavaUtils.durationFromMillis(Math.max(System.currentTimeMillis() - pendingDeployMarker.getTimestamp(), 0)));
Copy link
Contributor

Choose a reason for hiding this comment

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

thoughts on moving Math.max() into durationFromMillis()?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah that probably makes sense, I can move it

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

@ssalinas ssalinas merged commit 56924f9 into master Aug 30, 2016
@ssalinas ssalinas deleted the duration_millis branch August 30, 2016 16:13
@ssalinas ssalinas modified the milestone: 0.11.0 Sep 9, 2016
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.

SingularityDeployPoller IllegalArgumentException: durationMillis must not be negative
2 participants