Re: NIFI-14340 Replace the use of finalize

2025-03-29 Thread Bob Paulin
Hi Dan, I believe that will do the trick for the AbstractCacheServer.  The record approach looks pretty clean. The Cleaner.create() function does start a thread [1] that is used process the clean up method so it does mean the runnable implementing the run function does need to be mindful of

Re: NIFI-14340 Replace the use of finalize

2025-03-26 Thread Dan S
Bob thanks for your response. I am still confused how to apply the example you have to the actual StandardProcessSession as ultimately its rollback method has to be called and this method is not static. So how is it possible for the Runnable registered with the Cleaner not to have a handle on the S

Re: NIFI-14340 Replace the use of finalize

2025-03-24 Thread Dan S
Bob, Can you please take a look at the changes I made to AbstractCacheServer and see if those changes make sense. I am currently working on separating the state from StandardProcessSession although another wrinkle I n

Re: NIFI-14340 Replace the use of finalize

2025-03-19 Thread Bob Paulin
Hi Dan, It would seem to me all the instant variables used in the rollback and/or the methods it references would have to be sent arguments to the Runnable and the same actions rollback does and the methods it calls would have to be done by the Runnable. Is that correct? Yes, but any non-

Re: NIFI-14340 Replace the use of finalize

2025-03-19 Thread Dan S
Bob, It would seem to me all the instant variables used in the rollback and/or the methods it references would have to be sent arguments to the Runnable and the same actions rollback does and the methods it calls would have to be done by the Runnable. Is that correct? On Wed, Mar 19, 2025 at 4:57

Re: NIFI-14340 Replace the use of finalize

2025-03-18 Thread Bob Paulin
Formatting came through poorly. Please see [1] - Bob [1] https://gist.github.com/bobpaulin/ce6a83e45cd6bbf34051935324f10c63 On 2025/03/18 14:40:19 Bob Paulin wrote: > Hi > > In both cases it appears that finalize is being used as resource clean > up following the object being de-referenced. 

Re: NIFI-14340 Replace the use of finalize

2025-03-18 Thread Bob Paulin
Hi In both cases it appears that finalize is being used as resource clean up following the object being de-referenced.  In both cases finalize is not the primary means of cleanup but rather a fall-through for exceptional cases where processing is interrupted.  The consequences are different i

NIFI-14340 Replace the use of finalize

2025-03-17 Thread Dan S
I am currently working on NIFI-14340 trying to replace the overridden methods finalize in both AbstractCacheServer and StandardProcessSession as per the javadocs