Skip to content

fix: align frontend goroutine id with runtime dump - #25497

Merged
XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
aptend:investigate-25400
Jul 7, 2026
Merged

XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
aptend:investigate-25400

Conversation

@aptend

@aptend aptend commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #25400

What this PR does / why we need it:

This PR makes frontend goRoutineId use the existing runtime.Stack-based goroutine id parser, so ids printed in session_info and leak txn logs can be matched directly with goroutine <id> in goroutine dumps.

It also removes the extra cleanup-time goroutine id probe and keeps the cleanup log focused on the routine goroutine id. That avoids another runtime.Stack call during cleanup and keeps the field semantics aligned with the session/routine being cleaned.

Tested with:

go test ./pkg/util/debug/goroutine ./pkg/frontend -run 'TestGetRoutineId|Test_routineid'

@aptend
aptend requested a review from XuPeng-SH as a code owner July 7, 2026 03:02
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

The implementation change is small and coherent: frontend goroutine ids now reuse the same runtime.Stack-based parser as pkg/util/debug/goroutine, so the ids printed in session_info / leak-transaction logs line up with goroutine dump headers, and cleanup no longer does an extra probe from whatever goroutine happens to perform teardown. The targeted tests I checked passed, and I didn't find a substantive correctness regression in the nearby lifecycle paths.

One non-blocking follow-up: the new test mainly covers the nil-session cleanup path, but the PR's core claim (id matches runtime dump format) is still only weakly asserted. A focused test comparing GetRoutineId() with a runtime.Stack header would tighten that up nicely.

@mergify mergify Bot added the queued label Jul 7, 2026
@mergify

mergify Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-07-07 08:28 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-07-07 13:04 UTC · at 98137834f7ec6565f689388b99ad3fea6eda3734

This pull request spent 4 hours 35 minutes 51 seconds in the queue, with no time running CI.

Reason

The pull request can't be updated

This pull request seems to come from a fork, and Mergify needs the author's permission to update its branch.
The author needs to enable "Allow edits from maintainers" on this pull request, or update the branch manually.

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

@XuPeng-SH
XuPeng-SH merged commit 8829299 into matrixorigin:main Jul 7, 2026
20 of 21 checks passed
@mergify mergify Bot added dequeued and removed queued labels Jul 7, 2026
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [x] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#25400

## What this PR does / why we need it:

This PR makes frontend `goRoutineId` use the existing
`runtime.Stack`-based goroutine id parser, so ids printed in
`session_info` and leak txn logs can be matched directly with `goroutine
<id>` in goroutine dumps.

It also removes the extra cleanup-time goroutine id probe and keeps the
cleanup log focused on the routine goroutine id. That avoids another
`runtime.Stack` call during cleanup and keeps the field semantics
aligned with the session/routine being cleaned.

Tested with:

```sh
go test ./pkg/util/debug/goroutine ./pkg/frontend -run 'TestGetRoutineId|Test_routineid'
```

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [x] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#25400

## What this PR does / why we need it:

This PR makes frontend `goRoutineId` use the existing
`runtime.Stack`-based goroutine id parser, so ids printed in
`session_info` and leak txn logs can be matched directly with `goroutine
<id>` in goroutine dumps.

It also removes the extra cleanup-time goroutine id probe and keeps the
cleanup log focused on the routine goroutine id. That avoids another
`runtime.Stack` call during cleanup and keeps the field semantics
aligned with the session/routine being cleaned.

Tested with:

```sh
go test ./pkg/util/debug/goroutine ./pkg/frontend -run 'TestGetRoutineId|Test_routineid'
```

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [x] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#25400

## What this PR does / why we need it:

This PR makes frontend `goRoutineId` use the existing
`runtime.Stack`-based goroutine id parser, so ids printed in
`session_info` and leak txn logs can be matched directly with `goroutine
<id>` in goroutine dumps.

It also removes the extra cleanup-time goroutine id probe and keeps the
cleanup log focused on the routine goroutine id. That avoids another
`runtime.Stack` call during cleanup and keeps the field semantics
aligned with the session/routine being cleaned.

Tested with:

```sh
go test ./pkg/util/debug/goroutine ./pkg/frontend -run 'TestGetRoutineId|Test_routineid'
```

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants