net: count application bytes in read_bytes for TLS#13282
Open
moonchen wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adjusts net.read_bytes accounting on TLS connections to count decrypted application payload bytes (plaintext), making it symmetric with net.write_bytes, and updates documentation to reflect the clarified semantics.
Changes:
- Move
net.read_bytes/net.read_bytes_countincrements from raw socket reads to post-decryption reads inSSLNetVConnection. - Stop counting TLS handshake / record-layer bytes toward
net.read_bytes. - Document that
read_bytes/write_bytesrepresent application-layer plaintext for TLS connections.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/iocore/net/SSLNetVConnection.cc | Shifts read-byte metrics to count decrypted payload instead of raw network bytes for TLS. |
| doc/admin-guide/monitoring/statistics/core/network-io.en.rst | Documents TLS plaintext semantics for read_bytes and write_bytes. |
Contributor
Author
|
[approve ci Clang-Analyzer] |
On TLS connections, net.read_bytes was only counting some bytes for the handshake, and none of the incoming ciphertext. This is neither intuitive nor consistent with net.write_bytes. The fix for now is to make it symmetric with net.write_bytes. Count the plaintext bytes for TLS. This means not counting the handshake bytes. For a long term fix, I plan to add more comprehensive metrics for TLS.
073804f to
85e94c5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On TLS connections, net.read_bytes was only counting some bytes for the handshake, and none of the incoming ciphertext. This is neither intuitive nor consistent with net.write_bytes.
The fix for now is to make it symmetric with net.write_bytes. Count the plaintext bytes for TLS. This means not counting the handshake bytes.
For a long term fix, I plan to add more comprehensive metrics for TLS.