NIFI-14006 Fixed Manifest Merger to avoid multiple reads for HTTP Responses (#9518)

- Corrects behavior when running in a cluster required after changes to read from response streams instead of buffering the entire response body in memory

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
Bryan Bende 2024-11-13 17:08:10 -05:00 committed by GitHub
parent 919b376c16
commit 6b2dd3209f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ public class RuntimeManifestEndpointMerger implements EndpointResponseMerger {
final Set<Bundle> responseBundles = responseManifest.getBundles() == null ? new LinkedHashSet<>() : new LinkedHashSet<>(responseManifest.getBundles());
for (final NodeResponse nodeResponse : successfulResponses) {
final RuntimeManifestEntity nodeResponseEntity = nodeResponse.getClientResponse().readEntity(RuntimeManifestEntity.class);
final RuntimeManifestEntity nodeResponseEntity = nodeResponse == clientResponse ? responseEntity : nodeResponse.getClientResponse().readEntity(RuntimeManifestEntity.class);
final RuntimeManifest nodeResponseManifest = nodeResponseEntity.getRuntimeManifest();
final List<Bundle> nodeResponseBundles = nodeResponseManifest.getBundles() == null ? Collections.emptyList() : nodeResponseManifest.getBundles();
responseBundles.retainAll(nodeResponseBundles);