generated from streamnative/pulsar-io-template
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: cleanup the current batch after flush crashed (#824)
### Motivation In the existing logic, whether the flush operation fails or succeeds, the variables `currentBatchSize` and `currentBatchBytes` will be cleared. However, if an error such as an Out of Memory (OOM) exception occurs during the flush operation, it will be caught here: https://github.com/streamnative/pulsar-io-cloud-storage/blob/06d8c33afa7d813ffc2019ed4331a3883f9f9044/src/main/java/org/apache/pulsar/io/jcloud/sink/BlobStoreAbstractSink.java#L217-L221 Nonetheless, the batch might not be cleared properly. This could result in an empty queue, despite `currentBatchSize` and `currentBatchBytes` not being reset to 0. ### Modifications - The batch is now cleared before the actual flush operation takes place.
- Loading branch information
1 parent
7418e11
commit f2a2a2f
Showing
2 changed files
with
24 additions
and
7 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