libp2p / js-libp2p

The JavaScript Implementation of libp2p networking stack.
https://libp2p.io
Other
2.27k stars 436 forks source link

Yamux pontentially sending a WindowUpdate after it has closed the stream #2505

Open diegomrsantos opened 2 months ago

diegomrsantos commented 2 months ago

Severity: High if it is actually an issue on JS side.

Description:

These are the logs filtered by streamId: 1:

2024-04-24T11:58:31.0169041Z listener-1  | TRC 2024-04-24 11:58:25.717+00:00 got message                                topics="libp2p yamux" tid=7 h="{WindowUpdate, {Syn}, streamId: 1, length: 0}"
2024-04-24T11:58:31.0176726Z listener-1  | TRC 2024-04-24 11:58:25.717+00:00 write directly on stream                   topics="libp2p yamux" tid=7 h="{WindowUpdate, {Ack}, streamId: 1, length: 0}"
2024-04-24T11:58:31.0239117Z listener-1  | TRC 2024-04-24 11:58:25.726+00:00 got message                                topics="libp2p yamux" tid=7 h="{Data, {}, streamId: 1, length: 36}"
2024-04-24T11:58:31.0633568Z listener-1  | TRC 2024-04-24 11:58:25.771+00:00 try to send the buffer                     topics="libp2p yamux" tid=7 h="{Data, {}, streamId: 1, length: 20}"
2024-04-24T11:58:31.0641794Z listener-1  | TRC 2024-04-24 11:58:25.772+00:00 try to send the buffer                     topics="libp2p yamux" tid=7 h="{Data, {}, streamId: 1, length: 16}"
2024-04-24T11:58:31.0676154Z listener-1  | TRC 2024-04-24 11:58:25.775+00:00 try to send the buffer                     topics="libp2p yamux" tid=7 h="{Data, {}, streamId: 1, length: 127}"
2024-04-24T11:58:31.0683902Z listener-1  | TRC 2024-04-24 11:58:25.775+00:00 write directly on stream                   topics="libp2p yamux" tid=7 h="{Data, {Fin}, streamId: 1, length: 0}"
2024-04-24T11:58:31.1071982Z listener-1  | TRC 2024-04-24 11:58:25.808+00:00 got message                                topics="libp2p yamux" tid=7 h="{WindowUpdate, {}, streamId: 1, length: 20}"
2024-04-24T11:58:31.1112419Z listener-1  | TRC 2024-04-24 11:58:25.811+00:00 got message                                topics="libp2p yamux" tid=7 h="{WindowUpdate, {}, streamId: 1, length: 16}"
2024-04-24T11:58:31.1194427Z listener-1  | TRC 2024-04-24 11:58:25.818+00:00 got message                                topics="libp2p yamux" tid=7 h="{WindowUpdate, {Fin}, streamId: 1, length: 0}"
2024-04-24T11:58:31.1313826Z listener-1  | TRC 2024-04-24 11:58:25.831+00:00 got message                                topics="libp2p yamux" tid=7 h="{WindowUpdate, {}, streamId: 1, length: 127}"

Steps to reproduce the error:

The test is flaky, but running it sometimes reproduces the situation described.