nandorKollar commented on code in PR #4487:
URL: https://github.com/apache/polaris/pull/4487#discussion_r3266950837
##########
runtime/service/src/test/java/org/apache/polaris/service/events/listeners/inmemory/InMemoryBufferEventListenerBufferSizeTest.java:
##########
@@ -97,4 +99,58 @@ void testProcessorFailureRecovery() {
sendAsync("test1", 10);
assertRows("test1", 10);
}
+
+ /**
+ * Regression coverage for the concurrent-{@code onNext} race on the
per-realm {@link
+ * UnicastProcessor} held by {@link InMemoryBufferEventListener#processors}.
+ *
+ * <p>The Reactive Streams specification (rule 1.3) requires {@code
onNext()} to be called
+ * sequentially, and Mutiny's {@code UnicastProcessor} relies on that
contract; concurrent {@code
+ * onNext()} invocations on the same processor can silently drop events. The
{@link
+ * InMemoryBufferEventListener#processEvent} method serializes those calls
via {@code
+ * synchronized(processor)}; this test exercises that path under deliberate
concurrency and
+ * asserts the expected number of events lands in the events table.
+ */
+ @Test
+ void testProcessEventIsThreadSafe() throws InterruptedException {
Review Comment:
It seems to me, that this test passes even when I don't apply the changes on
`InMemoryBufferEventListener.java`.
_Edit_: Never mind, should've read the description, that this is not a
deterministic test case.
--
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]