Skip to content

Upgrade async-profiler to 4.6 - #3281

Merged
hengyunabc merged 2 commits into
masterfrom
codex/upgrade-async-profiler-4.6
Oct 23, 2026
Merged

hengyunabc merged 2 commits into
masterfrom
codex/upgrade-async-profiler-4.6

Conversation

@hengyunabc

@hengyunabc hengyunabc commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Upgrade the bundled async-profiler from 4.4 directly to 4.6. Reference #3267 for context; this is an independent upgrade from current master.

  • Replace Linux x64, Linux arm64, and universal macOS native libraries with the official non-debug release artifacts, verified against the release asset SHA-256 digests.

  • Sync the existing four Java API classes with tag v4.6, commit 557276c2950c14a5ad7073e2bef5a16616309247, including dumpOtlp(Counter).

  • Keep the existing meminfo action for terminal/HTTP/MCP callers, but translate it to native metrics. Native meminfo was already absent in 4.4; the result now contains Prometheus metrics while retaining the meminfo model action. Update its documentation and add a regression test.

  • Add native tests in isolated JVMs for version/loading, wall sampling and thread-name filtering, both collapsed/OTLP counters, HTML/tree and JFR output, stopping, and class-loader collection. They run through the existing Java CI on supported platforms.

  • Update Chinese/English documentation for macOS 11+, ithread/xthread replacing thread-ID filters, combined HTML views, the removed upstream HTTP server, and actual version/metrics output.

  • Use the repository's Maven Wrapper for every JavaCI build, pinning Maven to 3.9.9 (including mvnw.cmd on Windows). This preserves the existing JDK 8 tools.jar dependency behavior after runner-provided Maven 3.10.0 stopped activating the wrapper dependency's file-based profile.

The Java API scope was re-evaluated against 4.6. Upstream fixed #1811 and #1818 by avoiding eager Recording initialization when the native library loads. Explicit Recording use still establishes a JNI global reference. Arthas does not use the Java Span API, so keep its existing API subset and document why Agent, Recording, and Span are not bundled. Normal profiling and JFR do not require them.

Validation:

  • CI toolchain fix: JDK 8 with Maven Wrapper 3.9.9, ./mvnw -V -B -ntp -pl core -am clean package -DargLine=-XX:+StartAttachListener — 341 tests passed, no failures/errors/skips. Workflow YAML parsing and git diff --check passed.
  • JDK 8: ./mvnw -B -ntp -pl core,agent,client,boot,packaging -am clean package -DargLine=-XX:+StartAttachListener -Darthas.site.frontend.skip=true — 385 tests passed, no failures/errors/skips. The site frontend was built separately with npm --prefix site run docs:build — all 156 pages built.
  • Verified that the distribution ZIP contains exactly the three updated native binaries, and the packaged core JAR contains only the four expected profiler API classes with Java 8 bytecode.
  • macOS arm64, JDK 8 and 21: real ArthasClassloader checks passed for CPU/HTML, CPU JFR, wall/allocation/monitor-lock JFR, and collection after stopping. JDK 21 jfrsync passed. Parsed the recordings and checked their event counts.
  • Attached the clean distribution to fresh JDK 8/21 JVMs and exercised profiler version, meminfo, CPU HTML, thread-filtered wall/Markdown, JFR and status through the HTTP API.
  • macOS x64 under Rosetta, JDK 8: native sampling/output and class-loader collection probe passed.
  • Final focused profiler tests, documentation build, and git diff --check passed.

Linux native runtime was not tested locally; the new native tests cover Linux x64 in the existing CI matrix. The Linux GLIBC symbol requirements match the previous bundled libraries (x64: up to 2.16; arm64: 2.17). The full-project/JDK 17+ integration suite was not run locally.

Native library SHA-256:

Library SHA-256
Linux x64 1aa55af4645fafb7b70fe78b8bcc8d32a1a2fce1a278ce04318224df68694fb2
Linux arm64 45895af951d172126819552f5e2762b1a71c4db2a95ab8def791becb9ce7e35d
macOS universal bf3f48291999c1d97ae7e7102bc75f458eec91f5e70f2c23c032c24f9a575c8b

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T09:41:17.151274Z — PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@hengyunabc
hengyunabc merged commit 2b6d0e5 into master Oct 23, 2026
16 checks passed
@hengyunabc
hengyunabc deleted the codex/upgrade-async-profiler-4.6 branch October 23, 2026 11:04
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.

RecordingAPI JNI global reference prevents class loader unloading

1 participant