-
Notifications
You must be signed in to change notification settings - Fork 2.8k
NIFI-14399 Removed finalize method from StandardProcessSession. #9829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@markap14 When speaking with @exceptionfactory regarding this change, he felt the use of |
I suppose if we have process sessions which are yet to be rolled back yet we've been willing to just let the reference dangle...we have deeper problems. Given the finalize call is going away there likely isn't much we can or should do here anyway. It was a nice peace of mind thing... |
I think this is probably okay. This exists as a safeguard against buggy Processors. In particular, if you create a Processor that extends AbstractSessionFactoryProcessor, you have full control over the ProcessSession. This ensures that if that processor calls So it helped to kind of ensure that we do all we can to protect ourselves against buggy Processors. But at the end of the day, there's really only so much we can do. Processors can still open sockets, file handles, etc. and fail to close them and leak resources that way. And they could still potentially hold on to references to the Process Sessions, preventing the finalizer from being called also. While I think it is nice to have it there, given the deprecation of finalizers, it's probably reasonable to just remove the method. |
@sfc-gh-mpayne Thanks for getting back. Although |
interesting https://inside.java/2022/05/25/clean-cleaner/ |
@joewitt If we want to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on Mark's response, I'm inclined to proceed with removing the finalize()
method as proposed.
Implementing something based on a Cleaner
sounds interesting, but also potentially complicated for a questionable amount of usefulness.
Either way, I think a different approach would be better to implement in a separate issue.
Marking as approved and planning to merge later today unless there are any objections before then.
While we're waiting for you to merge this...does this mean this moment is.... the final countdown? man i hope that joke lands as funny as it is in my own head |
@joewitt Did you mean the |
always good to know who my fellow dad jokes/humor friends are. I see you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the discussion appears to be finalized
, I will proceed with merging. Thanks all!
Summary
NIFI-14399
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000
NIFI-00000
Pull Request Formatting
main
branchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-check
Licensing
LICENSE
andNOTICE
filesDocumentation