Skip to content

Return NotFound when serializing allocation or lifetime profiles collected with sampling disabled. - #1795

Draft
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1011438924
Draft

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1011438924

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Return NotFound when serializing allocation or lifetime profiles collected with sampling disabled.

When TCMalloc profile sampling is disabled with a non-positive sampling interval, starting allocation or lifetime profiling previously constructed sample tables with sampling interval 1 and serialized an empty profile proto. HTTP profile handlers therefore returned 200 OK with an empty payload instead of signaling that sampling is disabled.

Make ProfileBase::SamplingInterval pure virtual across StackTraceTable, DeallocationStackTraceTable, and FakeProfile, preserve the configured sampling interval when sampling is disabled, and return a not-found error from MakeProfileProto when the recorded interval is non-positive. Add unit and handler tests covering both normal and sanitizer builds.

Co-authored-by: Chris Kennelly ckennelly@google.com

@google-cla

google-cla Bot commented Nov 1, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@copybara-service
copybara-service Bot force-pushed the test_1011438924 branch 2 times, most recently from 640ef0a to 598bb64 Compare November 1, 2026 16:28
@copybara-service copybara-service Bot changed the title Record the active sampling interval on allocation and lifetime profiles and return a kNotFound status when profile sampling is disabled. Return a dedicated disabled token when allocation or lifetime profiling starts with sampling turned off, and fail proto conversion with NotFound. Nov 1, 2026
@copybara-service
copybara-service Bot force-pushed the test_1011438924 branch 4 times, most recently from 0608689 to 56af6f4 Compare November 2, 2026 04:00
@copybara-service copybara-service Bot changed the title Return a dedicated disabled token when allocation or lifetime profiling starts with sampling turned off, and fail proto conversion with NotFound. Return NotFound when serializing allocation or lifetime profiles collected with sampling disabled. Nov 2, 2026
…ected with sampling disabled.

When TCMalloc profile sampling is disabled with a non-positive sampling interval, starting allocation or lifetime profiling previously constructed sample tables with sampling interval 1 and serialized an empty profile proto. HTTP profile handlers therefore returned 200 OK with an empty payload instead of signaling that sampling is disabled.

Make ProfileBase::SamplingInterval pure virtual across StackTraceTable, DeallocationStackTraceTable, and FakeProfile, preserve the configured sampling interval when sampling is disabled, and return a not-found error from MakeProfileProto when the recorded interval is non-positive. Add unit and handler tests covering both normal and sanitizer builds.

Co-authored-by: Chris Kennelly <ckennelly@google.com>
PiperOrigin-RevId: 1011438924

This branch has not been deployed

No deployments
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.

0 participants