You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Daniele Pirola (Jira)" <ji...@apache.org> on 2025/10/31 22:26:00 UTC

[jira] [Created] (NIFI-15169) ExecuteSQLRecord fails silently on sql exception when outputBatchSize is set

Daniele Pirola created NIFI-15169:
-------------------------------------

             Summary: ExecuteSQLRecord fails silently on sql exception when outputBatchSize is set
                 Key: NIFI-15169
                 URL: https://issues.apache.org/jira/browse/NIFI-15169
             Project: Apache NiFi
          Issue Type: Bug
          Components: Core Framework
    Affects Versions: 1.25.0
            Reporter: Daniele Pirola


Configure ExecuteSQLRecord component:
 * set outputBatchSize > 0
 * set fetchSize > 0

After first loop (fetch and route the result) if the database throw an error (session killed, snapshot too old, ...) the error is only logged and no flow files are routed to failure.

I think that the error has been generated by NIFI-6040 that when outputBatchSize is set erase fileToProcess variable.

When there is an Exception on the catch statement the code:           
{code:java}
            //If we had at least one result then it's OK to drop the original file, but if we had no results then
            //  pass the original flow file down the line to trigger downstream processors
            if (fileToProcess == null) {
                // This can happen if any exceptions occur while setting up the connection, statement, etc.
                logger.error("Unable to execute SQL select query {} due to {}. No FlowFile to route to failure",
                        new Object[]{selectQuery, e});
                context.yield();
            } else {{code}

log only the error silently




--
This message was sent by Atlassian Jira
(v8.20.10#820010)