JimmyZZZ opened a new pull request, #107: URL: https://github.com/apache/flink-connector-kafka/pull/107
## What is the purpose of the change Fix the bug for losing data during kafka cluster is unavailable for a while. The related issue: https://issues.apache.org/jira/browse/FLINK-35749 tells how to reproduce this bug. ## Brief change log The key problem is in WriterCallback#onCompletion of KafkaWriter: ```java mailboxExecutor.submit( () -> { // Checking for exceptions from previous writes checkAsyncException(); }, "Update error metric"); ``` 'mailboxExecutor.submit' without getting future back will not throw exception, which causes the 'asyncProducerException' is assign to null but the job seems like nothing happened. The fix is using 'mailboxExecutor.execute' instead of 'mailboxExecutor.submit'. ## Verifying this change Added new test case KafkaWriterFaultToleranceITCase to cover this bug. ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): no - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no - The serializers: no - The runtime per-record code paths (performance sensitive): no - Anything that affects deployment or recovery: no - The S3 file system connector: no ## Documentation - Does this pull request introduce a new feature? no - If yes, how is the feature documented? not applicable -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org