Closed kkrawczy closed 14 hours ago
Thanks for opening this issue @kkrawczy, we'll look into it and update here once we did, can't say when we'll get to it yet.
Thanks for the repro and your investigations @kkrawczy !
I've just opened a PR to fix this which gets rid of the blocking.
The first captured event takes a bit of time due to initializing the hostname cache. If you don't need the hostname and want to make it faster, you could set options.setAttachServerName(false);
in your Sentry.init
block.
We have just released 8.0.0-beta.3 which includes a fix for this issue. If you decide to give it a try, feedback would be great.
Integration
sentry
Java Version
19
Version
7.16.0
Steps to Reproduce
Run a script that triggers many
uncaughtException
and observe how slow the handling gets. This line in the console can confirm slowdown:Timed out waiting to flush event to disk before crashing. Event: %s
Simple script:Expected Result
Don't block the thread, which could potentially slow down different parts of the user app.
Most probably, the latch used by BlockingFlushHint should be properly released in RateLimiter like you already do for other hints (markHintWhenSendingFailed)
Actual Result
The thread blocks for 15 seconds, blocking other parts of the user application.
The workaround could be to reduce
flushTimeoutMillis
.