-
Notifications
You must be signed in to change notification settings - Fork 166
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
Remove CallContext and its ThreadLocal usage #589
Conversation
ea2175d
to
08a09f6
Compare
facd3fd
to
be93b0e
Compare
fbf254b
to
92f1632
Compare
92f1632
to
5c18e9c
Compare
Ready for review. |
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.
Thanks for this very nice cleanup!
This was a pretty major design decision, IMO. cc: @jbonofre @adutra @dennishuo @eric-maynard @flyrain @RussellSpitzer @takidau |
@collado-mike I think we all agree that a ThreadLocal is generally not a good choice. The issue tackled here is #463, which has been open for more than two months - nobody commented on that issue. Sure, this PR has been merged quite quickly, maybe too quick. But this PR does nothing else than what #463 describes. We all explicitly agreed that we want to move to CDI and we all explicitly agreed that we want to move to Quarkus. #463 also mentions that The documented contract of that interface said: The only implementation of that interface documents
It generally helps when the documentation are clear about the intent and structure of the code (package naming, module structure) supports/separates the intent and scope. It would be good to know what exactly is no longer possible with CC @jbonofre @dimas-b @adutra @takidau @dennishuo @eric-maynard @flyrain @RussellSpitzer |
@snazy I think two or three people have expressed unhappiness with the
ThreadLocal solution, but I think most of us have not expressed an opinion.
I don’t have a strong opinion for or against TLs - I said as much in the PR
that introduced `@RealmScoped` (which, BTW, has also been unceremoniously
deleted with no notice).
But to say that this PR does nothing more than what was stated in #463 is
strictly untrue. Removing the CallContext interface and the resolver is
akin to cutting off an arm because there was a minor infection.
_All_ interfaces in this project are potential extension points.
_Especially_ ones that are explicitly set in the project configuration.
We all agreed to use CDI, but that does not grant license to start removing
interfaces and APIs without any community feedback at all. What CDI has to
do with the existence of the CallContext interface is beyond me. CDI is
intended to allow for easier extension by allowing installations to replace
default implementations with new ones. The whole point is to support
extension.
Whether or not there are alternative solutions to do what the CallContext
interface allowed for is not the topic of discussion. Nobody is asking you
to help solve their problems. The concern is the lack of feedback requested
or even considered when making wide sweeping changes in a project that is
supposed to be the joint efforts of a community. There is a process to
propose interface deprecation and removal. This process exists to allow the
community to start using replacements over time but this process and the
impact on users in this community was completely ignored in this PR
|
This needs to be reverted and discussed. |
Now ready for review. It's a big PR, but there is no functional change here, only removals of
CallContext
andPolarisCallContext
.Fixes #463.
Removing
CallContext
is done in 2 commits that can be reviewed separately:PolarisCallContext
: this component is an aggregation of 3 application-scoped beans, and one request-scoped bean (the meta store session). It is "easy" to replace it by the components that are actually needed, however since it's used nearly everywhere, the blast radius is quite big. Application scoped beans are generally replaced with constructor injection, and request-scoped ones are passed through additional method arguments (except when the component is also request-scoped, in which case constructor injection is used).CallContext
proper. This is easier after step 1. The only issue is to revisit howPolarisCatalogHandlerWrapper
closes the base catalog. ThedoCatalogOperation
trick wasn't being done at the right level imho and could leave some catalogs unclosed in case of runtime errors.