dimas-b commented on code in PR #1816:
URL: https://github.com/apache/polaris/pull/1816#discussion_r2129107815
##########
polaris-core/src/main/java/org/apache/polaris/core/PolarisCallContext.java:
##########
@@ -94,4 +94,17 @@ public RealmContext getRealmContext() {
public PolarisCallContext getPolarisCallContext() {
return this;
}
+
+ @Override
+ public CallContext copy() {
+ // The realm context is a request scoped bean injected by CDI,
+ // which will be closed after the http request. This copy is currently
+ // only used by TaskExecutor right before the task is handled, since the
+ // task is executed outside the active request scope, we need to make a
+ // copy of the RealmContext to ensure the access during the task executor.
+ String realmId = this.realmContext.getRealmIdentifier();
+ RealmContext realmContext = () -> realmId;
+ return new PolarisCallContext(
+ realmContext, this.metaStore, this.diagServices,
this.configurationStore, this.clock);
Review Comment:
Good point about proxies :+1: I sand corrected :facepalm:
##########
polaris-core/src/main/java/org/apache/polaris/core/PolarisCallContext.java:
##########
@@ -94,4 +94,17 @@ public RealmContext getRealmContext() {
public PolarisCallContext getPolarisCallContext() {
return this;
}
+
+ @Override
+ public CallContext copy() {
+ // The realm context is a request scoped bean injected by CDI,
+ // which will be closed after the http request. This copy is currently
+ // only used by TaskExecutor right before the task is handled, since the
+ // task is executed outside the active request scope, we need to make a
+ // copy of the RealmContext to ensure the access during the task executor.
+ String realmId = this.realmContext.getRealmIdentifier();
+ RealmContext realmContext = () -> realmId;
+ return new PolarisCallContext(
+ realmContext, this.metaStore, this.diagServices,
this.configurationStore, this.clock);
Review Comment:
Good point about proxies :+1: I stand corrected :facepalm:
--
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]