-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a racy way to work around the issue, but fundamentally, from a client's perspective, we have limited options. Either we always flush everything and wait for successful responses, or we work around this with timing. I choose timing here. What we do is, when aborting, we wait for all sinks to be completely done with their produce requests. This solves most of the problem to begin with: before, we did not wait, so if we issued a produce request we could immediately proceed to issuing EndTxn, and the EndTxn may be handled first. By waiting, we _ensure_ that Kafka has handled our produce requests. However, if we wait and the request is cut, it may be that our connection died right after writing the produce request. In this case, we now see that the last produce request had an issuing error, and we wait 1s before sending EndTxn. The hope is that this 1s is enough time for the ProduceRequest to be processed by Kafka itself. We have effectively changed this issue from a slim change to an extremely slim chance under very bad conditions.
- Loading branch information
Showing
3 changed files
with
60 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters