NIFI-13927 Use synchronized lists in PublishGCPubSub (#9449)

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
Pierre Villard 2024-10-26 18:44:29 +02:00 committed by GitHub
parent 6d6adfeaeb
commit 31d92b5115
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -321,8 +321,8 @@ public class PublishGCPubSub extends AbstractGCPubSubWithProxyProcessor {
for (final FlowFile flowFile : flowFileBatch) {
final List<ApiFuture<String>> futures = new ArrayList<>();
final List<String> successes = new ArrayList<>();
final List<Throwable> failures = new ArrayList<>();
final List<String> successes = Collections.synchronizedList(new ArrayList<>());
final List<Throwable> failures = Collections.synchronizedList(new ArrayList<>());
if (flowFile.getSize() > maxMessageSize) {
final String message = String.format("FlowFile size %d exceeds MAX_MESSAGE_SIZE", flowFile.getSize());
@ -368,8 +368,8 @@ public class PublishGCPubSub extends AbstractGCPubSubWithProxyProcessor {
for (final FlowFile flowFile : flowFileBatch) {
final List<ApiFuture<String>> futures = new ArrayList<>();
final List<String> successes = new ArrayList<>();
final List<Throwable> failures = new ArrayList<>();
final List<String> successes = Collections.synchronizedList(new ArrayList<>());
final List<Throwable> failures = Collections.synchronizedList(new ArrayList<>());
final Map<String, String> attributes = flowFile.getAttributes();
try (final RecordReader reader = readerFactory.createRecordReader(