This is an automated email from the ASF dual-hosted git repository.

exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 31d92b5115 NIFI-13927 Use synchronized lists in PublishGCPubSub (#9449)
31d92b5115 is described below

commit 31d92b5115003991bf7bcca66c354ad9ba447f22
Author: Pierre Villard <[email protected]>
AuthorDate: Sat Oct 26 18:44:29 2024 +0200

    NIFI-13927 Use synchronized lists in PublishGCPubSub (#9449)
    
    Signed-off-by: David Handermann <[email protected]>
---
 .../org/apache/nifi/processors/gcp/pubsub/PublishGCPubSub.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/pubsub/PublishGCPubSub.java
 
b/nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/pubsub/PublishGCPubSub.java
index d201b17b68..2a93817e87 100644
--- 
a/nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/pubsub/PublishGCPubSub.java
+++ 
b/nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/pubsub/PublishGCPubSub.java
@@ -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(

Reply via email to