Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain, and the change includes a targeted conversion fix with regression coverage for current CreatedTime values.
No open issues 🎉
What changed in this PR
This PR fixes the /connections builtin service so CreatedTime correctly displays wall-clock timestamps after socket reset times switched to a monotonic clock.
Changes:
- Converts the monotonic socket reset timestamp into a wall-clock timestamp before formatting.
- Adds regression coverage validating current
CreatedTimevalues in plain-text/connectionsresponses.
| File | Description |
|---|---|
| test/brpc_builtin_service_unittest.cpp | Adds regression coverage that validates plain-text /connections output contains a current CreatedTime value. |
| src/brpc/builtin/connections_service.cpp | Converts the monotonic socket reset timestamp into wall-clock time before rendering CreatedTime. |
Review effort: Lite
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.
What problem does this PR solve?
Issue Number: resolve
Problem Summary:
12fb539aswitchedSocket::_reset_fd_real_ustobutil::cpuwide_time_us()(monotonic), butconnections_service.cppstill renders it withPrintRealDateTime(), which treats the value as microseconds since the Unix epoch. As a result theCreatedTimecolumn in/connectionsshows1970/01/01 + uptime(e.g.1971/03/11on a host up for 434 days).What is changed and the side effects?
Changed:
Convert the monotonic elapsed time back to wall clock before formatting.
Before:
1970/03/07-07:29:54After:
2026/11/24-16:42:15Side effects:
Performance effects:
Breaking backward compatibility:
Check List: