slachiewicz commented on PR #285: URL: https://github.com/apache/flink-connector-kafka/pull/285#issuecomment-5471446682
@Efrat19 good catch on the reflection — `getSentSourceEvent()` is public and I will switch to it. It will not remove the `ConcurrentModificationException` though. In `MockSplitEnumeratorContext`, `getSentSourceEvent()` copies on `workerExecutor` while `sendEventToSourceReader` writes on `mainExecutor`, and those are two separate single-thread executors created in the constructor, so the copy is not serialised against the writer. The copy is also shallow: `new HashMap<>(sentSourceEvent)` shares the `List<SourceEvent>` values, and it is that inner list this helper streams — which is where the CME actually comes from. So I would like to keep the catch alongside the accessor change. `hasLatestMetadataUpdateEvent` is a poll predicate, so returning false and retrying is the right response to a mid-write read. Removing the race properly means changing `MockSplitEnumeratorContext` in flink-core to copy on the main executor and deep-copy the value lists. Happy to file that separately if you think it is worth doing. *This comment was created with AI assistance.* -- 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]
