Skip to content

fix: force base-10 in bash _walltime_to_seconds#916

Merged
agronskiy merged 1 commit intomainfrom
agronskiy/fix-walltime-octal
Apr 17, 2026
Merged

fix: force base-10 in bash _walltime_to_seconds#916
agronskiy merged 1 commit intomainfrom
agronskiy/fix-walltime-octal

Conversation

@agronskiy
Copy link
Copy Markdown
Collaborator

@agronskiy agronskiy commented Apr 17, 2026

Reported here in slack:

  • I (we :claude:) think max_walltime was being silently ignored on job chains whose previous run landed on a zero-padded minute/second like 02:08:45 -- apparently bash interprets 08/09 as octal inside $((...)) the arithmetic errors out, _prev_elapsed_seconds stays empty, and the accumulated walltime stays stuck at 00:00:00 forever, so the chain keeps resuming past the limit.
  • solution -- p[refixing each field with 10# forces decimal parsing and restores the guard. Regression test runs the generated bash function against the offending inputs.

What checked

  • addad a test parametrized bash regression test covers 02:08:45, 04:09:06 and observed it failing -- then applied the fix

@agronskiy agronskiy requested review from a team as code owners April 17, 2026 08:10
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Apr 17, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@prokotg
Copy link
Copy Markdown
Collaborator

prokotg commented Apr 17, 2026

/ok to test 1da24d3

Bash treats 08/09 as invalid octal in $((...)) arithmetic, so zero-padded
sacct Elapsed fields (e.g. 02:08:45) were erroring out and leaving the
accumulated walltime at 0, defeating max_walltime. Prefix each field with
10# so parsing stays decimal, and add a bash regression test.

Signed-off-by: Alex Gronskiy <agronskiy@nvidia.com>
@agronskiy agronskiy force-pushed the agronskiy/fix-walltime-octal branch from 1da24d3 to 857ab03 Compare April 17, 2026 08:39
@agronskiy agronskiy enabled auto-merge (squash) April 17, 2026 08:51
@agronskiy
Copy link
Copy Markdown
Collaborator Author

/ok to test 857ab03

@agronskiy agronskiy merged commit 01899f8 into main Apr 17, 2026
48 checks passed
@agronskiy agronskiy deleted the agronskiy/fix-walltime-octal branch April 17, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants