Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dbg for remote nodes #8692

Merged
merged 1 commit into from
Aug 13, 2024
Merged

Conversation

michalmuskala
Copy link
Contributor

dbg uses the new trace sessions and stores them in the main dbg server on the node that's doing the tracing. However, trace sessions are reference-counted NIF resources - this means that when the last reference is GC'ed on the node that owns the resource, the resouce is destroyed.

In case of dbg, this meant that as soon as the first GC happened on the relay process, the session would be destroyed and tracing would silently stop. Furthermore, any subsequent requests to amend trace patterns, etc would fail for the remote nodes with badarg in trace module's functions.

This fixes the issue by making the relay process hold onto the session reference for as long as the process is active. This solves the issue.

The amended test fails before applying this change and succeeds after.

dbg uses the new trace sessions and stores them in the main dbg server
on the node that's doing the tracing. However, trace sessions are
reference-counted NIF resources - this means that when the last reference
is GC'ed on the node that owns the resource, the resouce is destroyed.

In case of dbg, this meant that as soon as the first GC happened
on the relay process, the session would be destroyed and tracing would
silently stop. Furthermore, any subsequent requests to amend
trace patterns, etc would fail for the remote nodes with badarg
in trace module's functions.

This fixes the issue by making the relay process hold onto the session
reference for as long as the process is active. This solves the issue.

The amended test fails before applying this change and succeeds after.
Copy link
Contributor

github-actions bot commented Jul 26, 2024

CT Test Results

  2 files   19 suites   6m 2s ⏱️
147 tests 131 ✅ 16 💤 0 ❌
165 runs  149 ✅ 16 💤 0 ❌

Results for commit eb8a6bf.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@michalmuskala michalmuskala changed the base branch from master to maint July 26, 2024 22:37
@jhogberg jhogberg self-assigned this Jul 29, 2024
@jhogberg jhogberg added team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI labels Jul 29, 2024
@jhogberg jhogberg merged commit 9e74606 into erlang:maint Aug 13, 2024
17 checks passed
@jhogberg
Copy link
Contributor

Merged, thanks for the PR!

@michalmuskala michalmuskala deleted the dbg-remote-trace-maint branch August 13, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants