Skip to content

atomicWrite support#3475

Open
jesup wants to merge 1 commit intousers/jesup/waitUntilAvailablefrom
users/jesup/atomicWrite
Open

atomicWrite support#3475
jesup wants to merge 1 commit intousers/jesup/waitUntilAvailablefrom
users/jesup/atomicWrite

Conversation

@jesup
Copy link
Copy Markdown
Member

@jesup jesup commented Mar 16, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 16, 2026 04:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds WebTransport “atomic write” support and exposes send-stream flow-control/buffering introspection by plumbing transport send-buffer state up through the HTTP/3 client layer.

Changes:

  • Add transport send-stream buffered() reporting and expose it via Connection::stream_send_buffered().
  • Extend the HTTP/3 send-stream abstraction to allow downcasting, enabling a WebTransport-specific atomic send path.
  • Add WebTransport tests covering atomic sends and flow-control/buffered-byte reporting.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
neqo-transport/src/send_stream.rs Adds SendStream::buffered() to report tx-buffered bytes.
neqo-transport/src/connection/mod.rs Exposes stream_send_buffered() on Connection.
neqo-http3/src/lib.rs Extends internal SendStream trait with as_any_mut() for downcasting.
neqo-http3/src/send_message.rs Implements as_any_mut() for SendMessage.
neqo-http3/src/features/extended_connect/session.rs Implements as_any_mut() for session send-stream wrapper.
neqo-http3/src/features/extended_connect/webtransport_streams.rs Adds WebTransport-specific send_atomic() and as_any_mut() implementation.
neqo-http3/src/connection.rs Adds webtransport_send_stream_atomic() that downcasts to WebTransportSendStream.
neqo-http3/src/connection_client.rs Adds public client APIs for flow-control info + atomic send.
neqo-http3/src/features/extended_connect/tests/webtransport/mod.rs Registers new atomic-write test module.
neqo-http3/src/features/extended_connect/tests/webtransport/atomic_write.rs Adds test coverage for atomic writes and flow-control/buffering info.

Comment thread neqo-transport/src/send_stream.rs Outdated
Comment thread neqo-http3/src/connection.rs Outdated
Comment thread neqo-http3/src/connection_client.rs Outdated
Comment thread neqo-http3/src/connection_client.rs Outdated
Comment thread neqo-transport/src/send_stream.rs Outdated
Comment thread neqo-http3/src/features/extended_connect/session.rs Outdated
Comment thread neqo-http3/src/connection_client.rs Outdated
@larseggert larseggert added the needs-rebase PR needs rebasing before it can be merged. label Apr 8, 2026
@jesup jesup force-pushed the users/jesup/waitUntilAvailable branch from 6ffa7e2 to c4a9fe7 Compare May 1, 2026 18:26
@jesup
Copy link
Copy Markdown
Member Author

jesup commented May 1, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

Failed Interop Tests

None ❓

All results

Succeeded Interop Tests

QUIC Interop Runner, client vs. server

neqo-pr as client

None ❓

neqo-pr as server

None ❓

Unsupported Interop Tests

QUIC Interop Runner, client vs. server

neqo-pr as client

None ❓

neqo-pr as server

None ❓

Copy link
Copy Markdown
Member

@martinthomson martinthomson left a comment

Choose a reason for hiding this comment

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

I believe that you have uncovered a bug to fix that is a bit deeper than this superficial fix.

self.stream.buffer(buf);
_ = self.stream.send_buffer(conn, now)?;
Ok(())
Ok(true)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where is the false?

Ok(conn.stream_send_atomic(self.stream_id, data)?)
} else {
// Can't send atomically yet, init buffer not fully sent
Ok(false)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So this is the only false return case? What about when the stream hasn't enough space to send?

};
self.stream.encode_with(|e| data_frame.encode(e));
self.stream.buffer(buf);
_ = self.stream.send_buffer(conn, now)?;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IMPORTANT: I don't think that this function is truly atomic. The stream has a method called send_atomic, but this goes nowhere near that. So I think we're into false promises here. I DON'T think that it's enough to replace this line and the next with a simple call. What you will need to do is ensure that the HTTP/3-layer buffer is passed down AND that a new buffer (including the length field) can be passed down atomically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase PR needs rebasing before it can be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants