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

filesystem: send 'ready' on fsread1 and fslist1 #19196

Merged

Conversation

allisonkarlitskaya
Copy link
Member

It's not really conceptually clear that we should send 'ready' on channels that don't expect to receive data, so we haven't done it until now.

Unfortunately, Channel.ready() is also the place we thaw the receive side of the channel, so those channels were never being thawed. The only place this matters for is flow control: pong messages will be received and queued, but never delivered, causing the channel to stall out after the window is filled for the first time.

Let's send 'ready' everywhere. That fixes the flow control issue. It's what the C bridge does as well.

Adjust our generic channel test case to make sure we always get the 'ready' message. Also move our uses of the low-level .send_open() for the fsread1 and fslist1 channels to use .check_open() (which waits for the ready message).

Since we now see 'ready' in cases where the bridge isn't expecting data, remove a couple of assertions stipulating that the channel was definitely open to receive that data — it's possible we're getting a ready message from a channel that already sent all of its data and closed.

Fixes #19192

It's not really conceptually clear that we should send 'ready' on
channels that don't expect to receive data, so we haven't done it until
now.

Unfortunately, `Channel.ready()` is also the place we thaw the receive
side of the channel, so those channels were never being thawed.  The
only place this matters for is flow control: pong messages will be
received and queued, but never delivered, causing the channel to stall
out after the window is filled for the first time.

Let's send 'ready' everywhere.  That fixes the flow control issue.  It's
what the C bridge does as well.

Adjust our generic channel test case to make sure we always get the
'ready' message.  Also move our uses of the low-level `.send_open()` for
the `fsread1` and `fslist1` channels to use `.check_open()` (which waits
for the ready message).

Since we now see 'ready' in cases where the bridge isn't expecting data,
remove a couple of assertions stipulating that the channel was
definitely open to receive that data — it's possible we're getting a
ready message from a channel that already sent all of its data and
closed.

Fixes cockpit-project#19192
Copy link
Member

@mvollmer mvollmer left a comment

Choose a reason for hiding this comment

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

Looks good to me! (But does this mean we didn't have any test for the flow control stuff?)

@allisonkarlitskaya
Copy link
Member Author

Looks good to me! (But does this mean we didn't have any test for the flow control stuff?)

We indeed lacked a unit test there. That got added in this PR.

@allisonkarlitskaya allisonkarlitskaya merged commit 8a5bfc6 into cockpit-project:main Aug 14, 2023
34 of 35 checks passed
@allisonkarlitskaya allisonkarlitskaya deleted the flowcontrol branch August 14, 2023 15:53
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.

Reading a 8M binary file no longer completes with the Python bridge
2 participants