Skip to content

Commit 6610ef1

Browse files
fix: Rare flush timeout when called in tight loop (#4257)
Fix an edge case that flush could keep timing out when called in a tight loop. The test case testFlush_WhenNoInternet_BlocksAndFinishes does this and sometimes fails with 'Flush should not time out'. This is fixed now, by removing the duplicate setting of isFlushing to NO in two different synchronize blocks.
1 parent 9067467 commit 6610ef1

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ This bug caused unhandled/crash events to have the unhandled property and mach i
2525
- Fix accessing UI API on bg thread in enrichScope (#4245)
2626
- EXC_BAD_ACCESS in SentryMetricProfiler (#4242)
2727
- Missing '#include <sys/_types/_ucontext64.h>' (#4244)
28+
- Rare flush timeout when called in tight loop (#4257)
2829

2930
### Improvements
3031

Sources/Sentry/SentryHttpTransport.m

-4
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,6 @@ - (SentryFlushResult)flush:(NSTimeInterval)timeout
209209

210210
intptr_t result = dispatch_group_wait(self.dispatchGroup, dispatchTimeout);
211211

212-
@synchronized(self) {
213-
self.isFlushing = NO;
214-
}
215-
216212
if (result == 0) {
217213
SENTRY_LOG_DEBUG(@"Finished flushing.");
218214
return kSentryFlushResultSuccess;

0 commit comments

Comments
 (0)