Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix for runner timeout handling #7390

Merged
merged 6 commits into from May 21, 2023

Conversation

christian-monch
Copy link
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
Copy link

codecov bot commented May 19, 2023

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
Copy link
Member

@yarikoptic yarikoptic left a comment

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)

changelog.d/pr-7390.md Outdated Show resolved Hide resolved
datalad/runner/nonasyncrunner.py Show resolved Hide resolved
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 and others added 2 commits May 20, 2023 10:33
@christian-monch
Copy link
Contributor Author

christian-monch commented May 20, 2023

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
20 of 22 checks passed
@yarikoptic
Copy link
Member

Thank you @christian-monch

@yarikoptic-gitmate
Copy link
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.

None yet

3 participants