File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
sentry/src/main/java/io/sentry/logger Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 1111
1212- Only attach user attributes to logs if `sendDefaultPii` is enabled ([#5036](https://github.com/getsentry/sentry-java/pull/5036))
1313
14+ ### Fixes
15+
16+ - Reject new logs if `LoggerBatchProcessor` is shutting down ([#5041](https://github.com/getsentry/sentry-java/pull/5041))
17+
1418### Dependencies
1519
1620- Bump Native SDK from v0.12.2 to v0.12.3 ([#5012](https://github.com/getsentry/sentry-java/pull/5012))
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ public class LoggerBatchProcessor implements ILoggerBatchProcessor {
3838 private volatile @ Nullable Future <?> scheduledFlush ;
3939 private final @ NotNull AutoClosableReentrantLock scheduleLock = new AutoClosableReentrantLock ();
4040 private volatile boolean hasScheduled = false ;
41+ private volatile boolean isShuttingDown = false ;
4142
4243 private final @ NotNull ReusableCountLatch pendingCount = new ReusableCountLatch ();
4344
@@ -51,6 +52,9 @@ public LoggerBatchProcessor(
5152
5253 @ Override
5354 public void add (final @ NotNull SentryLogEvent logEvent ) {
55+ if (isShuttingDown ) {
56+ return ;
57+ }
5458 if (pendingCount .getCount () >= MAX_QUEUE_SIZE ) {
5559 options
5660 .getClientReportRecorder ()
@@ -70,6 +74,7 @@ public void add(final @NotNull SentryLogEvent logEvent) {
7074 @ SuppressWarnings ("FutureReturnValueIgnored" )
7175 @ Override
7276 public void close (final boolean isRestarting ) {
77+ isShuttingDown = true ;
7378 if (isRestarting ) {
7479 maybeSchedule (true , true );
7580 executorService .submit (() -> executorService .close (options .getShutdownTimeoutMillis ()));
You can’t perform that action at this time.
0 commit comments