Skip to content

Bug fix for runner timeout handling - #7390

Merged
yarikoptic merged 6 commits into
datalad:maintfrom
christian-monch:bf-runner-timeout-handling
May 21, 2023
Merged

Bug fix for runner timeout handling#7390
yarikoptic merged 6 commits into
datalad:maintfrom
christian-monch:bf-runner-timeout-handling

Conversation

@christian-monch

Copy link
Copy Markdown
Contributor

This PR ensures that output generated by timeout-handlers is accessible to clients that iterate over a result-generator. The fixes
an error, where consecutive timeouts without any other event in between them where not delivered by the result-generator.

This bug was detected during work on issue #7315, but is independent.

This commit ensures that output generated by
timeouts is accessible to clients. It fixes
an error, where consecutive timeouts without
any other event in between where not available
to clients that used a generator-protocol.
This commit modifies BatchedCommand to emit
debug messages, if timeouts are encountered.

Note: in order to match the old implementation,
BatchedCommand uses a default timeout of
11 seconds. This holds, even when
timeout=None was specified on BatchedCommand
construction.
@codecov

codecov Bot commented May 19, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 100.00% and project coverage change: +2.52 🎉

Comparison is base (9bee9b9) 88.18% compared to head (1f9e74e) 90.70%.

Additional details and impacted files
@@            Coverage Diff             @@
##            maint    #7390      +/-   ##
==========================================
+ Coverage   88.18%   90.70%   +2.52%     
==========================================
  Files         327      327              
  Lines       44686    44693       +7     
  Branches        0     5924    +5924     
==========================================
+ Hits        39405    40541    +1136     
+ Misses       5281     4136    -1145     
- Partials        0       16      +16     
Impacted Files Coverage Δ
datalad/cmd.py 93.70% <100.00%> (+0.04%) ⬆️
datalad/runner/nonasyncrunner.py 98.15% <100.00%> (+0.02%) ⬆️

... and 43 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@yarikoptic yarikoptic added the semver-patch Increment the patch version when merged label May 19, 2023

@yarikoptic yarikoptic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor docs etc notes. Logic seems to be LGTM although I am not familiar much with this code

edit: typing issues observed:

datalad/runner/nonasyncrunner.py:561: error: Unsupported operand types for >= ("float" and "None")  [operator]
datalad/runner/nonasyncrunner.py:561: note: Right operand is of type "Optional[float]"
Found 1 error in 1 file (checked 32 source files)

Comment thread changelog.d/pr-7390.md Outdated
Comment thread datalad/runner/nonasyncrunner.py
This commit adds a check for None. This is
required to pass mypy checks. The variable
in question is already checked for None, but
mypy does not recognize this.
TODO: there is probably a better way to inform
mypy about valid assertions.
@christian-monch
christian-monch force-pushed the bf-runner-timeout-handling branch from 6a8d14f to 9122da0 Compare May 19, 2023 21:06
christian-monch and others added 2 commits May 20, 2023 10:33
@christian-monch

christian-monch commented May 20, 2023

Copy link
Copy Markdown
Contributor Author

Found 1 error in 1 file (checked 32 source files)

I fixed the error by adding a check for self.timeout is not None. I don't like the fix particularly, because it is just added to get around the mypy-error. We know already that self.timeout is not None at that point. Still, it fixes the error.

@yarikoptic
yarikoptic merged commit c9e6686 into datalad:maint May 21, 2023
@yarikoptic

Copy link
Copy Markdown
Member

Thank you @christian-monch

@yarikoptic-gitmate

Copy link
Copy Markdown
Collaborator

PR released in 0.18.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-patch Increment the patch version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants