gh-yzou commented on PR #1758: URL: https://github.com/apache/polaris/pull/1758#issuecomment-2922999031
@dimas-b After some more investigation, actually, i don't think CDI injection here is a robust way to handle configuration store. The TaskExecutor was failing with error like ContextNotActiveException, the reason seems that CDI injection doesn't work well when the access is made outside the scoped, like background task, which is what TaskExecutor does. Since when handle task is called, it does have a callContext passed, like this ``` protected void handleTask(long taskEntityId, CallContext ctx, int attempt) ``` It does mean it need to get the configuration of a particular realm, instead of the default. I think the real robust way is just passing the callContext to the call its-self, instead of use CDI injection for this case. in other words, have call like following ``` public <T> @Nullable T getConfiguration(@Nonnull CallContext ctx, String configName) ``` and we will remove ``` @Inject private Instance<RealmContext> realmContextInstance; ``` WDYT? -- 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]
