Skip to content
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

Fix for negative durations #1252

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

ssalinas commented Aug 26, 2016

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

@ssalinas ssalinas added the hs_staging label Aug 26, 2016
@@ -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)));

This comment has been minimized.

Copy link
@tpetr

tpetr Aug 29, 2016

Member

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

This comment has been minimized.

Copy link
@ssalinas

ssalinas Aug 29, 2016

Author Member

yeah that probably makes sense, I can move it

This comment has been minimized.

Copy link
@ssalinas

ssalinas Aug 29, 2016

Author Member

updated

@ssalinas ssalinas merged commit 56924f9 into master Aug 30, 2016
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@ssalinas ssalinas deleted the duration_millis branch Aug 30, 2016
@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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.