Fix raw debug output for negative estimated end durations - #848
Draft
rootkiller6788 wants to merge 1 commit into
Draft
Fix raw debug output for negative estimated end durations#848rootkiller6788 wants to merge 1 commit into
rootkiller6788 wants to merge 1 commit into
Conversation
When an experiment's completed job count exceeds its expected total
(e.g. after jobs are retried), the "estimated end" duration computed in
endpoint_experiment becomes negative. chrono::Duration::to_std() rejects
negative durations, so humanize() fell back to the raw Debug formatting,
producing output like `TimeDelta { secs: -1, nanos: 884994194 }` on the
experiment page.
Report such durations as "0 seconds" instead of leaking the internal
TimeDelta representation.
Contributor
|
The account has been banned for spamming and will not be responding further to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #761.
Problem
On the experiment page, the
Estimated endfield sometimes showed the raw debug representation of achrono::Duration, e.g.:Root cause
In
src/server/routes/ui/experiments.rs,endpoint_experimentcomputes the estimated remaining time as:total_jobsiscrates_len * 2whilecompleted_jobsis the count of rows in theresultstable. Retried or extra result rows can makecompleted_jobsexceedtotal_jobs, producing a negative duration.chrono::Duration::to_std()rejects negative values, sohumanize()fell through toformat!("{duration:?}"), leaking the internalTimeDeltarepresentation into the UI.Fix
humanize()now reports a negative (unrepresentable) duration as0 secondsinstead of the raw debug output.Verification
raw_progressreturns(results_len, crates_len * 2), socompleted_jobs > total_jobsis reachable when extra result rows exist (e.g. retried jobs).chrono0.4.45Duration(aTimeDeltaalias) debug-prints asTimeDelta { secs: ..., nanos: ... }, matching the screenshot in the issue.