This is an automated email from the ASF dual-hosted git repository. joewitt pushed a commit to branch support/nifi-1.28 in repository https://gitbox.apache.org/repos/asf/nifi.git
commit 870dc9f157e9ea0d338f3024f958e5a7b4bf4729 Author: Pierre Villard <[email protected]> AuthorDate: Mon Oct 28 11:40:02 2024 +0100 NIFI-13927 Use synchronized lists in PublishGCPubSub This closes #9456. Signed-off-by: Peter Turcsanyi <[email protected]> --- .../org/apache/nifi/processors/gcp/pubsub/PublishGCPubSub.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/pubsub/PublishGCPubSub.java b/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/pubsub/PublishGCPubSub.java index b80d8d5120..796347dab5 100644 --- a/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/pubsub/PublishGCPubSub.java +++ b/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/pubsub/PublishGCPubSub.java @@ -318,8 +318,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()); @@ -365,8 +365,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(
