mirror of https://github.com/apache/nifi.git
NIFI-13927 Use synchronized lists in PublishGCPubSub (#9449)
Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
6d6adfeaeb
commit
31d92b5115
|
@ -321,8 +321,8 @@ public class PublishGCPubSub extends AbstractGCPubSubWithProxyProcessor {
|
||||||
|
|
||||||
for (final FlowFile flowFile : flowFileBatch) {
|
for (final FlowFile flowFile : flowFileBatch) {
|
||||||
final List<ApiFuture<String>> futures = new ArrayList<>();
|
final List<ApiFuture<String>> futures = new ArrayList<>();
|
||||||
final List<String> successes = new ArrayList<>();
|
final List<String> successes = Collections.synchronizedList(new ArrayList<>());
|
||||||
final List<Throwable> failures = new ArrayList<>();
|
final List<Throwable> failures = Collections.synchronizedList(new ArrayList<>());
|
||||||
|
|
||||||
if (flowFile.getSize() > maxMessageSize) {
|
if (flowFile.getSize() > maxMessageSize) {
|
||||||
final String message = String.format("FlowFile size %d exceeds MAX_MESSAGE_SIZE", flowFile.getSize());
|
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) {
|
for (final FlowFile flowFile : flowFileBatch) {
|
||||||
final List<ApiFuture<String>> futures = new ArrayList<>();
|
final List<ApiFuture<String>> futures = new ArrayList<>();
|
||||||
final List<String> successes = new ArrayList<>();
|
final List<String> successes = Collections.synchronizedList(new ArrayList<>());
|
||||||
final List<Throwable> failures = new ArrayList<>();
|
final List<Throwable> failures = Collections.synchronizedList(new ArrayList<>());
|
||||||
|
|
||||||
final Map<String, String> attributes = flowFile.getAttributes();
|
final Map<String, String> attributes = flowFile.getAttributes();
|
||||||
try (final RecordReader reader = readerFactory.createRecordReader(
|
try (final RecordReader reader = readerFactory.createRecordReader(
|
||||||
|
|
Loading…
Reference in New Issue