-
Notifications
You must be signed in to change notification settings - Fork 34
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
Session not terminating upon closed CONNECT
stream
#197
Comments
wtransport/wtransport/src/driver/mod.rs Line 639 in 22fdfb9
|
@BiagioFesta if nobody is working on this I'll start with it. |
Please, it would be great. Definitely you can try a shot. I started a branch: https://github.com/BiagioFesta/wtransport/tree/close-session-capsule ( In particular, the commit ae63af0 implementing the capsule protocol, with the webtransport close session capsule |
Nice, I'll take a look. |
I figure that I only need to |
So, #8 is unresolved yet. |
@wegylexy can you provide a minimal example? Also what version of this crate are you using? Based on the logs, the closure was detected and its propagation to local streams is right after it so I'm not sure what went wrong in your case. |
@ktff If you look at the timestamps, the propagation took 30 seconds, which is exactly my configured // server.rs
// following example server code but using latest commit on `master` branch
async fn handle_session_core(incoming: IncomingSession) -> Result<()> {
let request = incoming.await?;
let connection = request.accept().await?
tokio::select! {
biased; // <-- doesn't matter
// closed = connection.closed() => { /* only TimedOut in this case, no ApplicationClosed */ }
stream = connection.accept_bi() => { stream? }
stream = connection.accept_uni() => { stream? }
datagram = connection.receive_datagram() => { datagram? }
}
}
// all 3 cases propagate the ConnectionError::ApplicationClosed after max_idle_timeout // client.js
const wt = new WebTransport(..., { requireUnreliable: true, congestionControl: "low-latency", ... });
// must wait until connected for closing code and reason to go through
wt.close(); // with code and reason or not
await wt.closed // if didn't wait til connected, promise is rejected immediately; server won't know |
The
wtransport
server is not terminating the session upon receiving a closedCONNECT
stream.According to the WebTransport Internet Draft:
Also under 5. Session Termination
Ruling out
quinn
I added tracing logs in quinn to see the various Frames processed and dispatched. Maybe the desired Frame wasn't being sent!
To verify this wasn't a problem on
quinn
's end, I wrote aJS
client in Chrome. That is:To close the session, I called:
When closing, I immediately receive a
Frame::Stream
fromquinn
:This payload indicates that the
CONNECT
stream has been closed. This is because thesession_id
is 0 andfin
is set totrue
.Testing this behavior on Firefox, I received a
CLOSE_WEBTRANSPORT_SESSION
upon closing theJS
client. This is fine since it is specified in the Session Termination section of the internet draft.Our
wtransport
server is similar to the implementation in examples. It seems other people are experiencing #176 (comment) @BiagioFesta hinted this may be a browser bug as well.Specifications
wtransport
version: 0.1.12- Chrome (Version 127.0.6533.89)
- (Firefox 129.0 (64-bit))
Issues mentioned
#176 (comment)
The text was updated successfully, but these errors were encountered: