cubelog: remove the dead requestTrace aggregation path - #1481
Closed
dwin-gharibi wants to merge 1 commit into
Closed
dwin-gharibi wants to merge 1 commit into
dwin-gharibi wants to merge 1 commit into
Conversation
Signed-off-by: Dwin Gharibi <dwin.gharibi@email.kntu.ac.ir>
dwin-gharibi
requested review from
chenhengqi,
fslongjin and
ls-ggg
as code owners
August 21, 2026 11:42
Review: cubelog — remove the dead requestTrace aggregation pathVerdict: Approve. This is a clean, well-scoped dead-code deletion. I verified the claims against the base tree. Verification
Notes
No correctness, reuse, or style issues found in the changed code. This review was generated by an AI assistant and is not a human approval. |
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.
Closes #1480.
Motivation
requestTraceis never constructed anywhere in the tree, so its methodsindexKey()andrealKey()have no callers, and
slice2Str()is called only fromrealKey(). The whole block is unreachable.It is not harmless dead weight:
go vetreportspossible misuse of reflect.StringHeaderatmetric.go:179, insideslice2Str. Keeping unreachable unsafe-pointer code around means that warningsits in the build output forever and any future reader has to work out whether it matters.
What this changes
cubelog/metric.go— deletes 109 lines:type requestTrace struct(:77-130)func (m *requestTrace) indexKey()(:128)func (m *requestTrace) realKey()(:142)func slice2Str(b []byte) string(:173)and drops the four imports that only that block used:
bytes,reflect,strconv,unsafe.ioandtimeremain.The exported
RequestTracetype (different type, capital R) andTrace()are untouched — those arethe live API.
Verified nothing outside the deleted block referenced any of these identifiers:
Cubelet/services/images/volumelifetime.gohas its own separateslice2Str/realKeywhich arelive and are deliberately left alone here — they belong to the unsafe-header issue.
No comment changes.
Testing
Deletion only, so no new tests. Existing coverage confirms nothing depended on it:
CI gates checked locally:
gofmt -l .— clean (fmt-check).go build ./...,go test ./...,go vet ./— all clean.git diff --stat:cubelog/metric.go | 109 ------, 1 file changed, 109 deletions.Risk / rollout
Very low — removing code with no callers and no exported surface. If the aggregation was intended to
come back, this PR is the wrong direction and it should be wired up instead; the deleted code is
recoverable from history either way.