Skip to content

HBASE-29853 Move from async profiler binary to a maven dependency#7679

Open
mnpoonia wants to merge 3 commits into
apache:masterfrom
mnpoonia:hbase_async_profiler
Open

HBASE-29853 Move from async profiler binary to a maven dependency#7679
mnpoonia wants to merge 3 commits into
apache:masterfrom
mnpoonia:hbase_async_profiler

Conversation

@mnpoonia

Copy link
Copy Markdown
Contributor

No description provided.

@Apache-HBase

This comment has been minimized.

@mnpoonia mnpoonia force-pushed the hbase_async_profiler branch from 91ff534 to 8a7bcaa Compare January 26, 2026 16:32
@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 39s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ master Compile Tests _
+0 🆗 mvndep 0m 25s Maven dependency ordering for branch
+1 💚 mvninstall 4m 21s master passed
+1 💚 compile 11m 54s master passed
+1 💚 checkstyle 2m 29s master passed
+1 💚 spotbugs 11m 26s master passed
+1 💚 spotless 1m 12s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 19s Maven dependency ordering for patch
+1 💚 mvninstall 3m 48s the patch passed
+1 💚 compile 13m 25s the patch passed
+1 💚 javac 13m 25s root generated 0 new + 1886 unchanged - 2 fixed = 1886 total (was 1888)
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 3m 0s root: The patch generated 0 new + 0 unchanged - 1 fixed = 0 total (was 1)
+1 💚 xmllint 0m 0s No new issues.
+1 💚 spotbugs 11m 30s the patch passed
+1 💚 hadoopcheck 18m 11s Patch does not cause any errors with Hadoop 3.3.6 3.4.1.
+1 💚 spotless 1m 3s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 39s The patch does not generate ASF License warnings.
94m 23s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7679/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7679
Optional Tests dupname asflicense javac codespell detsecrets xmllint hadoopcheck spotless compile spotbugs checkstyle hbaseanti
uname Linux 93f23ab627a1 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 8a7bcaa
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 194 (vs. ulimit of 30000)
modules C: hbase-resource-bundle hbase-http . U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7679/2/console
versions git=2.34.1 maven=3.9.8 spotbugs=4.7.3 xmllint=20913
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 37s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 23s Maven dependency ordering for branch
+1 💚 mvninstall 4m 42s master passed
+1 💚 compile 3m 35s master passed
+1 💚 javadoc 3m 12s master passed
+1 💚 shadedjars 7m 58s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 30s Maven dependency ordering for patch
+1 💚 mvninstall 4m 32s the patch passed
+1 💚 compile 3m 26s the patch passed
+1 💚 javac 3m 26s the patch passed
+1 💚 javadoc 3m 49s the patch passed
+1 💚 shadedjars 7m 49s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
-1 ❌ unit 263m 57s /patch-unit-root.txt root in the patch failed.
310m 49s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7679/2/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7679
Optional Tests javac javadoc unit shadedjars compile
uname Linux 9f19bff6798d 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 8a7bcaa
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7679/2/testReport/
Max. process+thread count 4615 (vs. ulimit of 30000)
modules C: hbase-resource-bundle hbase-http . U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7679/2/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@apurtell

Copy link
Copy Markdown
Contributor

Async profiler is an optional dependency. The availability of a profiler on the server side can be a security risk and so some (or many) may opt not to place one there. This change does not gracefully handle the absence of the profiler nor make its deployment optional.

@mnpoonia mnpoonia force-pushed the hbase_async_profiler branch from 8a7bcaa to 268b567 Compare May 3, 2026 10:45
@mnpoonia mnpoonia force-pushed the hbase_async_profiler branch from 268b567 to 05919a4 Compare May 3, 2026 11:00
@mnpoonia

mnpoonia commented May 3, 2026

Copy link
Copy Markdown
Contributor Author

Async profiler is an optional dependency. The availability of a profiler on the server side can be a security risk and so some (or many) may opt not to place one there. This change does not gracefully handle the absence of the profiler nor make its deployment optional.

Good point. Updated PR addresses both concerns: the dependency is now marked true so it is never transitively pulled into downstream modules. Users who want to bundle it can activate
the async-profiler Maven profile (-Pasync-profiler). Absence is handled gracefully — HttpServer checks ProfileServlet.isAvailable() at startup and falls back to DisabledServlet (returning HTTP 500
with a clear message) when neither the JAR nor ASYNC_PROFILER_HOME is present.

@mnpoonia

mnpoonia commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

@apurtell FYI. Hopefully i have addressed the concerns.

@mnpoonia

Copy link
Copy Markdown
Contributor Author

@virajjasani Please review

@apurtell apurtell 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.

Almost there. There's a first use case where we could be more graceful in explaining the error.

Also consider a hbase.profiler.enabled = < true | false > configuration setting that allows operators to selectively disable the profiler even if the binaries are present in the deployment. Just a thought.

startStopperThread(request.getDuration(), request, outputFile);

writeAcceptedResponse(resp, request, outputFile);
} catch (InterruptedException e) {

@apurtell apurtell May 20, 2026

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.

The native library won't actually be loaded until first use, which will happen in doGet, and there could be other native layer issues such as a glibc missing some versioned symbols, kernel disabled perf_event support, a seccomp policy, etc. Catching Error here, or even Throwable and then testing for instanceof InterruptedException to deal with that specific case would handle all of this. Otherwise UnsatisfiedLinkError (most likely) will bubble up to the servlet container which will emit a generic 500 error response.

…toggle, and cleanup

- Catch Error (UnsatisfiedLinkError, glibc mismatch, perf_event disabled, seccomp)
  in ProfileServlet.doGet so native load failures return a descriptive 500 instead
  of bubbling to the servlet container as a generic error
- Add hbase.profiler.enabled config (default true) to HttpServer so operators can
  disable the /prof endpoint via config even when the async-profiler binary is present
- Cache ProfilerBackend.detect() result in a static field so isAvailable() and the
  default constructor share one detection call instead of each triggering reflective
  class-loading at startup
- Reduce getAsyncProfilerHome() from public to package-private
- Add TestHttpServer#testProfilerDisabledByConfig to verify the new config flag

Co-authored-by: Claude <noreply@anthropic.com>
@mnpoonia mnpoonia force-pushed the hbase_async_profiler branch from cbf1ae2 to e55e963 Compare June 9, 2026 10:47
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.

3 participants