fix: poll job.status() once per job in Experiment.status() - #5
Open
andrewwhitecdw wants to merge 2 commits into
Open
fix: poll job.status() once per job in Experiment.status()#5andrewwhitecdw wants to merge 2 commits into
andrewwhitecdw wants to merge 2 commits into
Conversation
Experiment.status() called job.status(runner=...) twice while building one status row: once for the display text and again for the returned dictionary. A backend failure therefore produced two identical ERROR tracebacks per status request and wasted a redundant status poll. Store the status in a local variable and reuse it for both the display string and the dict. Add a regression test that asserts job.status() is called exactly once for both return_dict=True and the default print path. Signed-off-by: Andrew White <andrewh@cdw.com>
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.
Summary
Experiment.status()calledjob.status(runner=...)twice while building one status row: once for the display text and again for the returned dictionary. A backend failure therefore produced two identical ERROR tracebacks per status request and wasted a redundant status poll.This was flagged as a non-blocking follow-up in NVIDIA-NeMo#569.
Changes
job.status(runner=self._runner)in a local variable and reuse it for both the display string and the returned dict innemo_run/run/experiment.py.test/run/test_experiment.pyassertingjob.status()is called exactly once for bothreturn_dict=Trueand the default print path.Testing
Result: 1 passed.
Ruff lint and format also pass on the changed files.
Contributor guidelines