visit2rahul opened a new pull request, #4498:
URL: https://github.com/apache/polaris/pull/4498
## Summary
`UnicastProcessor.onNext()` is declared `public synchronized void` in
smallrye-mutiny, but `onComplete()` is not synchronized. The two methods can
therefore interleave: a concurrent `processEvent` (onNext) and eviction-driven
`onComplete` on the same processor have no mutual exclusion, which can silently
drop events at the eviction boundary.
This PR wraps both `onComplete()` call sites (the Caffeine eviction listener
and the `shutdown()` loop) in `synchronized (processor) { ... }` blocks so they
acquire the same intrinsic monitor that `onNext()` uses. `processEvent` itself
does not change.
## Background
Surfaced during review of #4487 by @nandorKollar. @adutra agreed it
warranted its own PR. Race interleaving details are in #4497.
## Test plan
No new test in this PR. The race window is microseconds at the eviction
boundary, controlled by Caffeine's internal cleanup thread; a deterministic
test of this interleaving is not portable. The fix is a small
synchronization-only diff (+20 / -3) that reviewers can verify by inspection.
Existing tests pass locally:
- `InMemoryBufferEventListenerBufferSizeTest` (4 tests)
- `InMemoryBufferEventListenerBufferTimeTest` (1 test)
- `InMemoryBufferEventListenerIntegrationTest` (1 test)
Closes #4497.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]