-
Notifications
You must be signed in to change notification settings - Fork 446
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
Yamux pontentially sending a WindowUpdate after it has closed the stream #2505
Comments
Hey @achingbrain! |
Perhaps this issue needs to be ported to https://github.com/ChainSafe/js-libp2p-yamux? |
@danisharora099 yes, that's the right place for this issue. Unfortunately I don't think GitHub lets us transfer issues between orgs, only between repos in the same org so it'll have to be recreated there.. |
It might be enough to update the stream state in YamuxStream.sendCloseWrite to be What do you think @wemeetagain? |
Opened an issue on js-libp2p-yamux as well: ChainSafe/js-libp2p-yamux#91 |
Yes this sound sensible |
Digging into this a bit: The problem is we're unilaterally sending a window update on consumption of each source chunk. Definitely missing a conditional to stop doing that. |
Version: js-v0_45
Platform: ubuntu-22.04
Subsystem: Yamux., used with ws and noise.
Severity: High if it is actually an issue on JS side.
Description:
What you did
The ping test sometimes fails when js is the dialer and nim-libp2p the listener. https://github.com/vacp2p/nim-libp2p/actions/runs/8815571518/job/24199161935?pr=1086
What happened
Nim is receiving a
{WindowUpdate, {}, streamId: 1, length: 127}
after it has received a{WindowUpdate, {Fin}, streamId: 1, length: 0}
. Nim sent{Data, {Fin}, streamId: 1, length: 0}
before receiving the messages above, so it believes the stream has been fully closed from both sides and doesn't accept the lastWindowUpdate
. It is possible that JS still hasn't received the Nim close msg. The Yamux spec says "To close a stream, either side sends a data or window update frame along with the FIN flag. This does a half-close indicating the sender will send no further data.". Does it includeWindowUpdate
?These are the logs filtered by
streamId: 1
:Not sure yet.
Steps to reproduce the error:
The test is flaky, but running it sometimes reproduces the situation described.
The text was updated successfully, but these errors were encountered: