This is an automated email from the ASF dual-hosted git repository.
bbende pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/master by this push:
new a9a4b76 NIFI-6517: Ensure that if IOException is thrown from
LoadBalanceSession that we properly catch the Exception, mark session as
complete, and then re-throw. There was one condition in which this was not
occurring. This commit addresses that situation.
a9a4b76 is described below
commit a9a4b765b179ceb573b87c17a8a1ab495b80e84a
Author: Mark Payne <[email protected]>
AuthorDate: Thu Aug 1 13:39:50 2019 -0400
NIFI-6517: Ensure that if IOException is thrown from LoadBalanceSession
that we properly catch the Exception, mark session as complete, and then
re-throw. There was one condition in which this was not occurring. This commit
addresses that situation.
This closes #3626.
Signed-off-by: Bryan Bende <[email protected]>
---
.../clustered/client/async/nio/LoadBalanceSession.java | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/clustered/client/async/nio/LoadBalanceSession.java
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/clustered/client/async/nio/LoadBalanceSession.java
index f5c35eb..c3496b8 100644
---
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/clustered/client/async/nio/LoadBalanceSession.java
+++
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/clustered/client/async/nio/LoadBalanceSession.java
@@ -136,14 +136,14 @@ public class LoadBalanceSession {
return false;
}
- // If there's already a data frame prepared for writing, just write to
the channel.
- if (preparedFrame != null && preparedFrame.hasRemaining()) {
- logger.trace("Current Frame is already available. Will continue
writing current frame to channel");
- final int bytesWritten = channel.write(preparedFrame);
- return bytesWritten > 0;
- }
-
try {
+ // If there's already a data frame prepared for writing, just
write to the channel.
+ if (preparedFrame != null && preparedFrame.hasRemaining()) {
+ logger.trace("Current Frame is already available. Will
continue writing current frame to channel");
+ final int bytesWritten = channel.write(preparedFrame);
+ return bytesWritten > 0;
+ }
+
// Check if the phase is one that needs to receive data and if so,
call the appropriate method.
switch (phase) {
case RECEIVE_SPACE_RESPONSE: