Skip to content

feat: log cross-namespace attach success - #3259

Merged
hengyunabc merged 1 commit into
masterfrom
agent/log-cross-namespace-attach
Aug 13, 2026
Merged

hengyunabc merged 1 commit into
masterfrom
agent/log-cross-namespace-attach

Conversation

@hengyunabc

Copy link
Copy Markdown
Collaborator

Summary

  • propagate the detected cross-mount-namespace attach mode through the internal agent arguments
  • write a structured success event to the target JVM's arthas.log after the Arthas server has started
  • add tests for metadata transmission and cross-namespace-only logging

Why

Follow-up to #3247. The attach-side success output and the target-side startup log currently look the same for normal and cross-mount-namespace attaches, so users cannot confirm which path succeeded.

After this change, a successful cross-namespace startup records:

event=arthas_attach status=success mode=cross-mount-namespace targetPid=... arthasHome=... network=... telnet=... http=...

Same-mount-namespace attaches do not emit this event.

Validation

  • ./mvnw -pl core -am -Dtest=ConfigureTest,ArthasBootstrapTest -Dsurefire.failIfNoSpecifiedTests=false test
  • ./mvnw -pl core -am test — 300 tests, 0 failures, 0 errors, 7 skipped
  • git diff --check

@hengyunabc
hengyunabc requested a balanced review from Copilot August 13, 2026 16:25
@hengyunabc
hengyunabc marked this pull request as ready for review August 13, 2026 16:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Propagates cross-mount-namespace attach metadata and records successful target JVM startup events.

Changes:

  • Transmits detected attach mode through agent arguments.
  • Logs structured cross-namespace startup details.
  • Adds metadata and logging tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
core/.../Arthas.java Propagates detected namespace mode.
core/.../Configure.java Adds internal namespace metadata.
core/.../ArthasBootstrap.java Emits the structured success event.
core/.../ConfigureTest.java Tests metadata transmission.
core/.../ArthasBootstrapTest.java Tests conditional event logging.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 108 to 111
if (crossMountNamespace) {
configure.setCrossMountNamespace(true);
socketSymlink = exposeTargetAttachSocket(targetPid);
}
@hengyunabc
hengyunabc merged commit 1219716 into master Aug 13, 2026
17 checks passed
@hengyunabc
hengyunabc deleted the agent/log-cross-namespace-attach branch August 13, 2026 16:34
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.

2 participants