aromanenko-dev commented on code in PR #27484:
URL: https://github.com/apache/beam/pull/27484#discussion_r1291327352
##########
sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/sqs/SqsIO.java:
##########
@@ -612,57 +655,95 @@ private void writeEntries(Batch batch, boolean
throwPendingFailures) {
}
public void finishBundle() throws Throwable {
- batches.writeAll();
+ if (expirationCheck != null) {
+ expirationCheck.cancel(false);
+ while (true) {
+ try {
+ expirationCheck.get(3, TimeUnit.SECONDS);
Review Comment:
nit: extract "3" a constant
##########
sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/sqs/SqsIO.java:
##########
@@ -709,8 +789,9 @@ private class Dynamic extends Batches {
(queue, batch) -> batch != null && batch.lock(true) ? batch :
createLocked(queue);
private final Map<@NonNull String, Batch> batches = new HashMap<>();
+ private final AtomicBoolean submitExpiredRunning = new
AtomicBoolean(false);
Review Comment:
Why do we need atomic types here if it's not thread safe?
--
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]