Skip to content

[DX-3778] Handle seconds=0 in the admin profile command#22135

Merged
pavel-raykov merged 1 commit intodevelopfrom
update-profile
Apr 23, 2026
Merged

[DX-3778] Handle seconds=0 in the admin profile command#22135
pavel-raykov merged 1 commit intodevelopfrom
update-profile

Conversation

@pavel-raykov
Copy link
Copy Markdown
Collaborator

@pavel-raykov pavel-raykov commented Apr 22, 2026

Before this PR we have always passed seconds as "?seconds=%d" arg to collect the corresponding profile.
After this PR we start to interpret seconds = 0 as "no seconds" argument.

This PR is required to obtain static (non-delta) heap profiles. Before this PR passing "seconds=0" would err in heap profiling - https://go.dev/src/net/http/pprof/pprof.go#L278. After this PR we can now obtain static heap profile. (To make things more complicated passing "seconds=0" to CPU profile would not err and reset profiling duration to 30 seconds.)

@github-actions
Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented Apr 22, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
Test_RegistrySynchronizer1_3_UpkeepReceivedLog The test failed due to an error fetching blockchain data because the current block height is lower than expected. Logs ↗︎
Test_CCIP_Upgrade_NoBlock_EVM2Sui The test failed due to an unspecified error during execution, with no clear indication of the specific cause. Logs ↗︎
Test_CCIP_Upgrade_NoBlock_EVM2Sui/OffRamp,_CCIP_FQ_upgraded_NoBlock:_Message_to_Sui_-_Should_Succeed The test failed due to a lack of new events being received, indicating a possible issue with event emission or processing. Logs ↗︎

View Full Report ↗︎Docs

@pavel-raykov pavel-raykov changed the title [DX-3778] Handle seconds=0 in admin profile command [DX-3778] Handle seconds=0 in the admin profile command Apr 22, 2026
@pavel-raykov pavel-raykov marked this pull request as ready for review April 22, 2026 18:19
Copilot AI review requested due to automatic review settings April 22, 2026 18:19
@pavel-raykov pavel-raykov requested review from a team as code owners April 22, 2026 18:19
@pavel-raykov pavel-raykov requested a review from jmank88 April 22, 2026 18:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Risk Rating: MEDIUM

Adjusts the admin profile command so that -seconds 0 is treated as “no seconds query parameter”, enabling static heap profiles (and avoiding invalid seconds=0 behavior in Go’s pprof handlers).

Changes:

  • Split vitals into “supports delta” vs “duration-based” groups and only include profile/trace in the default set when seconds > 0.
  • Stop unconditionally appending ?seconds=%d to pprof URIs; only add the query parameter when seconds > 0.
  • Update/add testscript coverage for the new vitals list output ordering and the seconds=0 behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
core/cmd/admin_commands.go Updates vitals selection and pprof URI construction to omit seconds when it’s 0.
testdata/scripts/admin/profile/test-seconds.txtar Adds a new script to exercise seconds=0 vs seconds>0 behavior.
testdata/scripts/admin/profile/multi-chain-loopp.txtar Updates expected vitals list ordering to match the new logic.

Areas requiring scrupulous human review:

  • core/cmd/admin_commands.go: vitals gating/validation around seconds > 0 and the pprof request URL construction (to ensure intended UX for -seconds 0 and correct defaults for other values).

Comment thread core/cmd/admin_commands.go
Comment thread testdata/scripts/admin/profile/test-seconds.txtar
@cl-sonarqube-production
Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
4.63% Technical Debt Ratio on New Code (required ≤ 4%)

See analysis details on SonarQube

@pavel-raykov pavel-raykov added this pull request to the merge queue Apr 23, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 23, 2026
@pavel-raykov pavel-raykov added this pull request to the merge queue Apr 23, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 23, 2026
@pavel-raykov pavel-raykov added this pull request to the merge queue Apr 23, 2026
Merged via the queue into develop with commit bfc4654 Apr 23, 2026
364 of 374 checks passed
@pavel-raykov pavel-raykov deleted the update-profile branch April 23, 2026 16:10
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.

4 participants