ing-mattioni commented on PR #11243: URL: https://github.com/apache/nifi/pull/11243#issuecomment-4830403735
> @ing-mattioni The PR rolls back `ProcessSession` and closes `AMQPResource` after an unexpected processor failure properly, but this point is missing which was listed under "Proposed changes" in the jira ticket: > > > Shut down the AMQP executor service when resource creation fails > > It makes sense to fix it too and I think it can be implemented only in the `catch` block of `createResource()` because `AMQPResource` object has not been created yet at this point of the execution. Thanks @turcsanyip for pointing this out. I updated createResource() to retain the AMQP executor reference during resource creation and shut it down in the failure path before rethrowing the original exception. This covers the case where AMQPResource has not been constructed yet, so normal AMQPResource.close() ownership has not started. I also added a focused unit test that simulates worker creation failure and verifies that the connection is closed and the executor is shut down. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
