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

qlog: Update ConnectionClose with CryptoError #1734

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

evanrittenhouse
Copy link
Contributor

@evanrittenhouse evanrittenhouse commented Feb 26, 2024

This makes the qlog crate fit the specification laid out in quicwg/qlog#392.

This yields the following ConnectionClose frame:

�{"time":5.063584,"name":"transport:packet_sent","data":{"header":{"packet_type":"1RTT","packet_number":5},"raw":{"length":49,"payload_length":11},"send_at_time":5.063584,"frames":[{"frame_type":"connection_close","error_space":"application_error","error_code":256,"reason":"kthxbye"}]}}

We won't be able to log CryptoErrors without a larger change that pushes detection of connection establishment into the qlog crate. We could also explore logging one of two different ConnectionClose events on close, one each for pre- and post-establishment, but that seemed messy. I can implement that if we do want to go down that route.

This makes the qlog crate fit the specification laid out in quicwg/qlog#392
@evanrittenhouse evanrittenhouse requested a review from a team as a code owner February 26, 2024 17:08
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
#[serde(untagged)]
pub enum ConnectionCloseErrorCode {
CryptoError(CryptoError),
Copy link
Contributor

Choose a reason for hiding this comment

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

#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
#[serde(untagged)]
pub enum ConnectionCloseErrorCode {
CryptoError(CryptoError),
Copy link
Contributor

Choose a reason for hiding this comment

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

The CryptoError type also needs to be updated to reflect the latest qlog spec - https://quicwg.org/qlog/draft-ietf-quic-qlog-quic-events.html#section-8.12.25

error_code_value: None, // raw error is no different for us
// TODO: determine if connection is established so we can log
// CryptoErrors
error_code: Some(ConnectionCloseErrorCode::Numeric(*error_code)),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think what we want to do instead convert all the known error codes to actual qlog transport or crypto errors, rather than a numeric one

Comment on lines +1002 to +1006
// TODO: determine if connection is established so we can log
// CryptoErrors
error_code: Some(ConnectionCloseErrorCode::Numeric(
*error_code,
)),
Copy link
Contributor

Choose a reason for hiding this comment

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

CryptoErrors cannot be sent in application close. And at the point we log things here, we don't know the application protocol. So I think its safe to just log the Numeric variant without a comment.

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.

None yet

2 participants