Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Currently, the site-to-site client in MiNiFi only accepts TRANSACTION_FINISHED(13) as a success code, and it treats everything else as failure:
if (code == TRANSACTION_FINISHED) { logger_->log_info("Site2Site transaction {} peer finished transaction", transactionID.to_string()); transaction->_state = TRANSACTION_COMPLETED; return true; } else { logger_->log_warn("Site2Site transaction {} peer unknown respond code {}", transactionID.to_string(), magic_enum::enum_underlying(code)); return false; }
On the other hand, the NiFi site-to-site client treats both TRANSACTION_FINISHED(13) and TRANSACTION_FINISHED_BUT_DESTINATION_FULL(14) as success codes:
switch (response) { case CONFIRM_TRANSACTION: logger.debug("{} Confirming transaction. checksum={}", this, explanation); commSession.setChecksum(explanation); commSession.setStatus(Transaction.TransactionState.DATA_EXCHANGED); break; case TRANSACTION_FINISHED: case TRANSACTION_FINISHED_BUT_DESTINATION_FULL: logger.debug("{} Transaction is completed. responseCode={}", this, response); commSession.setStatus(Transaction.TransactionState.TRANSACTION_COMPLETED); break; }
logger.debug("{} received {} from {}", new Object[]{this, transactionResponse, peer}); if (transactionResponse.getCode() == ResponseCode.TRANSACTION_FINISHED_BUT_DESTINATION_FULL) { peer.penalize(port.getIdentifier(), port.getYieldPeriod(TimeUnit.MILLISECONDS)); } else if (transactionResponse.getCode() != ResponseCode.TRANSACTION_FINISHED) { throw new ProtocolException("After sending data, expected TRANSACTION_FINISHED response but got " + transactionResponse); }
TRANSACTION_FINISHED_BUT_DESTINATION_FULL(14) can happen when the number or the total size of the files in the batch exceed the limits set in the Back Pressure settings of the outgoing connection of the input port on the server side.
MiNiFi should behave in the same way as NiFi: accept TRANSACTION_FINISHED_BUT_DESTINATION_FULL(14) as success, but the remote processor group should yield, so the server has time to clear the connection.
Attachments
Issue Links
- fixes
-
MINIFICPP-2287 Site-to-site with large files: "Site2Site transaction xxx peer unknown respond code 14"
- Resolved
- links to