-
Notifications
You must be signed in to change notification settings - Fork 6
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
Explicitly signal stream initiation and termination #29
Conversation
b6671cb
to
97aeb76
Compare
|
||
async with remote: | ||
async for v in forward_server_stream(request_iterator, remote): | ||
yield v | ||
|
||
del self.resources[resource_uuid] | ||
# del self.resources[resource_uuid] | ||
# small resources might be fully buffered in memory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sequence of event:
- client opens a stream for sharing resource
- exporter accepts the stream and registers the other end of the stream as a resource
- exporter starts task to forward data from the client side of the stream to the exporter side of the stream
3.1 (actually happened) stream is copied into internal buffer before being consumed, forward tasks exits, resource unregistered - (originally intended) driver get the stream from the dict and begins consuming the stream
4.1 (actually happened) driver fails to find resource - (originally intended) stream is fully consumed by the driver, forward tasks exits, resource unregistered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TLDR: resource shouldn't be unregistered when forwarding task exits, but only when it's fully consumed (or client decides to cancel)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation I see now :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, just some comments about logging all "pass calls"
57a9b39
to
2a3f62e
Compare
No description provided.