NIFI-495: Fixed handling of FlowFiles if destination full by rolling back session

This commit is contained in:
Mark Payne 2015-04-08 13:38:33 -04:00
parent 8d20b82095
commit 7819afbefd
1 changed files with 4 additions and 1 deletions

View File

@ -171,6 +171,7 @@ public class StandardRemoteGroupPort extends RemoteGroupPort {
this.targetRunning.set(false);
final String message = String.format("%s failed to communicate with %s because the remote instance indicates that the port is not in a valid state", this, url);
logger.error(message);
session.rollback();
remoteGroup.getEventReporter().reportEvent(Severity.ERROR, CATEGORY, message);
return;
} catch (final UnknownPortException e) {
@ -178,6 +179,7 @@ public class StandardRemoteGroupPort extends RemoteGroupPort {
this.targetExists.set(false);
final String message = String.format("%s failed to communicate with %s because the remote instance indicates that the port no longer exists", this, url);
logger.error(message);
session.rollback();
remoteGroup.getEventReporter().reportEvent(Severity.ERROR, CATEGORY, message);
return;
} catch (final IOException e) {
@ -186,13 +188,14 @@ public class StandardRemoteGroupPort extends RemoteGroupPort {
if ( logger.isDebugEnabled() ) {
logger.error("", e);
}
session.rollback();
remoteGroup.getEventReporter().reportEvent(Severity.ERROR, CATEGORY, message);
session.rollback();
return;
}
if ( transaction == null ) {
logger.debug("{} Unable to create transaction to communicate with; all peers must be penalized, so yielding context", this);
session.rollback();
context.yield();
return;
}