RE: [EXT] Re: Thoughts on an internal "Terminate" handler for special processors
Mark, Lots of good questions. I'll write up a JIRA on it at least, and finish reviewing your original PR on Terminate (https://github.com/apache/nifi/pull/2555/). Thanks, Peter -Original Message- From: Mark Payne Sent: Wednesday, June 19, 2019 9:27 AM To: dev@nifi.apache.org Subject: [EXT] Re: Thoughts on an internal "Terminate" handler for special processors Peter, Without thinking through this too much, I am not opposed to the idea, but there are certainly a lot of things that would have to be carefully thought through around the lifecycle: - When a processor is terminated, its threads are interrupted. They may or may not ignore the interrupt. When should this handler be triggered? After the threads return from the interrupt? Or after the interrupt is triggered and before they return (if they ever will)? - What if the Termination handler never returns? Does this just eat up an additional thread and get reported as a "Terminated thread"? What thread pool, if any, would this thread come from? Just some thoughts that would have to be worked through... > On Jun 19, 2019, at 11:17 AM, Peter Wicks (pwicks) wrote: > > I've run into a few cases where a processor that works with external > resources (DBCP especially) will hang and can't be properly terminated. I was > thinking it would make sense to have an interface or annotation that these > processors could have that would flag them for "special" termination. > > For example. In DBCP processors we could put a reference to the current > statement, and then when a terminate is received we can call into the > processor and ask it to perform it's special termination process, which in > this case would be to cancel the statement. > > I've heard similar complaints concerning ExecuteStreamCommand, but have not > experienced it. > > Any thoughts on this? It would only be for the Terminate option, it would not > affect normal operation states such as Stop. > > Thanks, > Peter Wicks
Re: Thoughts on an internal "Terminate" handler for special processors
Peter, Without thinking through this too much, I am not opposed to the idea, but there are certainly a lot of things that would have to be carefully thought through around the lifecycle: - When a processor is terminated, its threads are interrupted. They may or may not ignore the interrupt. When should this handler be triggered? After the threads return from the interrupt? Or after the interrupt is triggered and before they return (if they ever will)? - What if the Termination handler never returns? Does this just eat up an additional thread and get reported as a "Terminated thread"? What thread pool, if any, would this thread come from? Just some thoughts that would have to be worked through... > On Jun 19, 2019, at 11:17 AM, Peter Wicks (pwicks) wrote: > > I've run into a few cases where a processor that works with external > resources (DBCP especially) will hang and can't be properly terminated. I was > thinking it would make sense to have an interface or annotation that these > processors could have that would flag them for "special" termination. > > For example. In DBCP processors we could put a reference to the current > statement, and then when a terminate is received we can call into the > processor and ask it to perform it's special termination process, which in > this case would be to cancel the statement. > > I've heard similar complaints concerning ExecuteStreamCommand, but have not > experienced it. > > Any thoughts on this? It would only be for the Terminate option, it would not > affect normal operation states such as Stop. > > Thanks, > Peter Wicks
NiFi and Mockito 2.28.2
NiFi Developers, Recently, NIFI-6360 [1] was resolved with PR 3533 [2] merged to master. All NiFi components were upgraded to use Mockito version 2.28.2, including updating those components to use mockito-core instead of mockito-all since the mockito-all distribution was discontinued in Mockito 2. The Mockito dependency upgrade was one of several PRs (with a few more on the way) needed to support building NiFi on Java 11. For those of you with PRs open that reference Mockito, please rebase onto the current master. If you have specific issues with the Mockito upgrade, I'd be happy to help you resolve them. [1] https://issues.apache.org/jira/browse/NIFI-6360 [2] https://github.com/apache/nifi/pull/3533
Thoughts on an internal "Terminate" handler for special processors
I've run into a few cases where a processor that works with external resources (DBCP especially) will hang and can't be properly terminated. I was thinking it would make sense to have an interface or annotation that these processors could have that would flag them for "special" termination. For example. In DBCP processors we could put a reference to the current statement, and then when a terminate is received we can call into the processor and ask it to perform it's special termination process, which in this case would be to cancel the statement. I've heard similar complaints concerning ExecuteStreamCommand, but have not experienced it. Any thoughts on this? It would only be for the Terminate option, it would not affect normal operation states such as Stop. Thanks, Peter Wicks