consommé: improve tcp tracing - #4177
Conversation
There was a problem hiding this comment.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Note
This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
vm/devices/net/net_consomme/consomme/src/tcp.rs:128
TcpErrorKindis itself anError, but it isn't marked as the source ofTcpError, soTcpError::source()will returnNoneand error-chain reporting will lose the underlying kind. Markkindwith#[source]to preserve the error chain while keeping the structuredflowcontext in the top-level message.
#[error("{kind} for flow {flow}")]
pub struct TcpError {
flow: FourTuple,
kind: TcpErrorKind,
}
c4610ca to
6b287b9
Compare
There was a problem hiding this comment.
🟡 Changes recommended
TcpError now carries flow information but keeps it inaccessible to other crate modules, limiting the ability to emit structured src/dst fields when errors are handled/logged outside tcp.rs.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
There was a problem hiding this comment.
🟢 Approval recommended
The changes are localized to tracing/error plumbing and the updated call sites/tests appear consistent, with only a minor best-practice improvement suggested for error chaining.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
vm/devices/net/net_consomme/consomme/src/tcp.rs:139
TcpErrorwraps the underlying reason inkind, but it isn't marked as an error source. That meansstd::error::Error::source()will beNoneand downstream error reporting loses the underlyingTcpErrorKindin the error chain (even though it’s displayed). Consider markingkindas#[source]to preserve chaining while still attaching the flow.
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
This PR ensures all connection traces include structured
src/dstdetails and that TcpError(s) carry theFourTuplewith the error so that the traces can be related to a specific TCP flow; thus, making debugging the tcp state machine easier.