[WIP] Remove CallContext and its ThreadLocal usage #589
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requires #469 and #604.
Fixes #463.
Removing
CallContext
is done in 2 steps: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.