Skip to content

Commit

Permalink
NIFI-13927 Use synchronized lists in PublishGCPubSub (apache#9449)
Browse files Browse the repository at this point in the history
Signed-off-by: David Handermann <[email protected]>
  • Loading branch information
pvillard31 authored Oct 26, 2024
1 parent 6d6adfe commit 31d92b5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ private void onTriggerFlowFileStrategy(

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());
Expand Down Expand Up @@ -368,8 +368,8 @@ private void onTriggerRecordStrategyPublishRecords(

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(
Expand Down

0 comments on commit 31d92b5

Please sign in to comment.