Skip to content

Fix for negative durations#1252

Merged
ssalinas merged 2 commits into
masterfrom
duration_millis
Aug 30, 2016
Merged

Fix for negative durations#1252
ssalinas merged 2 commits into
masterfrom
duration_millis

Conversation

@ssalinas

Copy link
Copy Markdown
Contributor

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

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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
Contributor 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