Repository navigation
fix(profiling): Accept dots in the JVM profiling traces dir path - #6334
Draft
runningcode wants to merge 2 commits into
Draft
runningcode wants to merge 2 commits into
runningcode wants to merge 2 commits into
Conversation
JavaContinuousProfiler refused any traces directory whose path held one of 26 characters, including ".", so a cache dir like /home/app/.sentry or /opt/my.app logged "Disabling profiling". async-profiler only treats "," (its argument separator) and "%" (file name patterns) specially, so those are the only characters it still rejects. The check also only stopped the first start: init() marked itself done before validating and returned true from then on, so later starts went ahead with the rejected options. It now remembers the result, as the Android profiler does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
📲 Install BuildsAndroid
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Fixes two problems in how
JavaContinuousProfilerchecks the profiling traces directory.Dots no longer disable profiling. The profiler refused any traces directory whose path contained one of 26 characters,
.among them. A cache dir like/home/app/.sentryor/opt/my.app/cachelogged "Disabling profiling because traces directory path contains invalid character: .". async-profiler only treats two characters in the path specially:,separates its arguments (start,jfr,...,file=<path>);%starts a file-name pattern such as%por%{ENV}.So those two are all it rejects now. The rest were never special: no shell runs the command, and async-profiler only splits
key=valueat the first=.A rejected config now stays rejected.
init()marked itself done before it checked the options and returnedtrueon every later call. So only the first start was refused, and later starts went ahead with the same options, despite the "Disabling profiling" warning. It now remembers the result, asAndroidContinuousProfilerdoes.Sentry.initcreates the traces directory before it builds the profiler, so nothing can make the options valid after the first start.💡 Motivation and Context
Found while moving the sample system tests into the modules. Any checkout whose path has a dot, such as a worktree under
.claude/worktrees/, fails 16 ofJavaContinuousProfilerTest's 23 tests, because the fixture's relativetmpcache dir resolves to an absolute path. CI's checkout path has no dot, so it never saw this.For users, the effect is a lost first profile chunk and a misleading warning, rather than profiling being disabled.
💚 How did you test it?
New tests:
Both fail against
main's profiler and pass with the fix.In a checkout with a dot in its path,
JavaContinuousProfilerTestgoes from 16 failures out of 23 to 25 passing.:sentry-async-profiler:checkpasses.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
None.
🤖 Generated with Claude Code