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

Don't use TextReceiveStream as a context manager #299

Merged
merged 1 commit into from
Nov 12, 2022
Merged

Conversation

jwodder
Copy link
Member

@jwodder jwodder commented Nov 11, 2022

This is a guess at a possible way to deal with #293.

With this change, CancelledErrors raised inside the loop will no longer cause the Stream to be closed; that is instead delayed to kill_on_error().

With this change, CancelledErrors raised inside the loop will no longer cause
the Stream to be closed; that is instead delayed to `kill_on_error()`.
yield chunk
except BaseException:
log.exception("Exception raised while handling output from %s", desc)
raise
Copy link
Member

Choose a reason for hiding this comment

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

does stream need its await stream.aclose() in finally: or at the end of the try block?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it really needs to be called at all. stream.aclose() just closes the underlying stream, which is here p.stdout, but that should be taken care of by the open_process() context manager.

@jwodder
Copy link
Member Author

jwodder commented Nov 11, 2022

@yarikoptic The tests are failing because the test Dandisets aren't validating in time.

@yarikoptic
Copy link
Member

@yarikoptic The tests are failing because the test Dandisets aren't validating in time.

is it some new behavior of dandi-archive? then please alert dandi-archive team/file an issue.

@jwodder
Copy link
Member Author

jwodder commented Nov 11, 2022

@yarikoptic It's an old behavior which has resurfaced.

@jwodder
Copy link
Member Author

jwodder commented Nov 11, 2022

@yarikoptic Issue filed: dandi/dandi-archive#1365

@yarikoptic
Copy link
Member

ok, let's hope there is no side effects and give it a shot

@yarikoptic yarikoptic merged commit 613f2a9 into draft Nov 12, 2022
@yarikoptic yarikoptic deleted the no-with-stream branch November 12, 2022 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants