Mark Payne created NIFI-16320:
---------------------------------

             Summary: NullPointerException in StandardConnectorNode due to null 
working flow context
                 Key: NIFI-16320
                 URL: https://issues.apache.org/jira/browse/NIFI-16320
             Project: Apache NiFi
          Issue Type: Bug
          Components: Core Framework
            Reporter: Mark Payne
            Assignee: Mark Payne


GET /nifi-api/connectors/\{id}

can fail with a NullPointerException when a Connector is using an external 
configuration provider.
The exception is:
{code:java}
Cannot invoke "FrameworkFlowContext.getConfigurationContext()" because 
"this.workingFlowContext" is null
 at 
org.apache.nifi.components.connector.StandardConnectorNode.replaceWorkingConfiguration
{code}
The GET path loads the latest provider configuration and calls 
{{{}replaceWorkingConfiguration{}}}. At the same time, 
{{recreateWorkingFlowContext}} can destroy the current working flow context 
before the replacement is created and assigned. A concurrent GET can then see a 
null working context.
After the connector is initialized, callers must always observe a live working 
context. Replacement should install the new context before the previous one is 
destroyed, and Connector callbacks must not run while the working-context 
monitor is held.



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

Reply via email to