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

feat(qlog): log version_information on server #1531

Merged
merged 4 commits into from
Jan 16, 2024

Conversation

mxinden
Copy link
Collaborator

@mxinden mxinden commented Dec 27, 2023

This commit adds support for the qlog version_information QUIC event on the server.

See #1505 for the client side.

Depends on qlog patch release with cloudflare/quiche#1684 ✔️

Meta issue: #528

Fixes #1549

This commit adds support for the qlog [`version_information` QUIC
event](https://quicwg.org/qlog/draft-ietf-quic-qlog-quic-events.html#name-version_information)
on the server.

Depends on cloudflare/quiche#1684

Meta issue: mozilla#528
Copy link
Collaborator Author

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Following up on Martin's comment in #1505 (review):

For the server, look in server.rs for fn accept_connection(...).

Done in this pull request. Let me know if the direction is correct.

There shouldn't be a negotiated equivalent on the server

Do I understand correctly that you don't want to log the happy path, i.e. the case where version negotiation succeeds on the server? Fine by me.

For VN, you can make a call in fn process_input(...) right where it calls PacketBuilder::version_negotiation(...), which is where the Version Negotiation packet is sent.

Done in this pull request. Let me know if the direction is correct.


crate::qlog::server_version_information_failed(
&mut self.create_qlog_trace(&AttemptKey {
remote_address: dgram.source(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note that remote_address is not used by self.create_qlog_trace. Want me to change the signature of self.create_qlog_trace to only take the odcid?

Copy link
Member

Choose a reason for hiding this comment

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

That's worth doing. We might have needed an address once upon a time. Or maybe all the other instances where a trace was needed involved an address. Now that we have a case where we make a useless AttemptKey, it seems worthwhile changing the signature to eliminate that extra work (and have the other call sites use AttemptKey::odcid().

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 Continuing discussion in #1531 (review).

@codecov-commenter
Copy link

codecov-commenter commented Jan 13, 2024

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (abf2636) 86.52% compared to head (1617f56) 86.49%.
Report is 4 commits behind head on main.

Files Patch % Lines
neqo-transport/src/server.rs 65.62% 11 Missing ⚠️
neqo-transport/src/qlog.rs 44.44% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1531      +/-   ##
==========================================
- Coverage   86.52%   86.49%   -0.03%     
==========================================
  Files         117      117              
  Lines       38170    38264      +94     
==========================================
+ Hits        33025    33096      +71     
- Misses       5145     5168      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mxinden mxinden marked this pull request as ready for review January 13, 2024 12:54
@mxinden
Copy link
Collaborator Author

mxinden commented Jan 13, 2024

@martinthomson can you give this pull request a first review? Is this the direction you intended in #1505 (review)?

Copy link
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.

Once you get the refactoring sorted, I'll merge this. Sorry for missing it (I blame my vacation).


crate::qlog::server_version_information_failed(
&mut self.create_qlog_trace(&AttemptKey {
remote_address: dgram.source(),
Copy link
Member

Choose a reason for hiding this comment

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

That's worth doing. We might have needed an address once upon a time. Or maybe all the other instances where a trace was needed involved an address. Now that we have a case where we make a useless AttemptKey, it seems worthwhile changing the signature to eliminate that extra work (and have the other call sites use AttemptKey::odcid().

Copy link
Collaborator Author

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Thanks for the review. Mind taking another look @martinthomson?

fn create_qlog_trace(&self, attempt_key: &AttemptKey) -> NeqoQlog {
fn create_qlog_trace(&self, odcid: &ConnectionIdRef<'_>) -> NeqoQlog {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

PublicPacket::dcid returns a &ConnectionIdRef<'a>:

pub fn dcid(&self) -> &ConnectionIdRef<'a> {
&self.dcid
}

Thus I opted for create_qlog_trace to take a &ConnectionIdRef instead of a &ConnectionId since the former can be derived from the latter for free.

Let me know if that is fine by you, or whether you consider this a premature optimization not worth the noise.

(I am a bit confused why PublicPacket::dcid returns a reference to a reference (i.e. & and Ref<'_>) to some data. But that might be out of scope for this pull request.)

Copy link
Member

Choose a reason for hiding this comment

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

Oh, the ref to a ref is probably just to avoid putting Copy on that struct. Which is silly because it is just a reference itself.

@martinthomson martinthomson merged commit 0d6f3ea into mozilla:main Jan 16, 2024
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.

qlog version_information for server
3 participants