dariuszseweryn commented on PR #9737:
URL: https://github.com/apache/nifi/pull/9737#issuecomment-2675213568

   > That actually highlights a larger concern in that having the Processor 
hold on to the Session Factory in this way is generally poor practice and 
should be revisited.
   
   Given the Scheduler produces records at arbitrary moments we can:
   1. On each `onTrigger()` substitute the factory in the processor regularly
   2. Buffer the records and submit them only `onTrigger()` — this would need 
to have manual checkpointing, not sure yet how cumbersome will it be
   
   > Starting and stopping is less frequent, but the framework calls 
onTrigger() very frequently, thus inefficient nature of the synchronized block 
in a method that the framework calls repeatedly.
   
   The synchronization is only used if there is no `Scheduler` created yet, it 
uses (searches notes) _double-checked locking_ to avoid the synchronization 
overhead


-- 
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]

Reply via email to