Skip to content

Commit

Permalink
[apache#6236] fix(core): fix possible resource leak in BaseCatalog
Browse files Browse the repository at this point in the history
fix conflict.
  • Loading branch information
Abyss-lord committed Jan 15, 2025
1 parent 71c717a commit a655913
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.ws.rs.HEAD;

/**
* The abstract base class for Catalog implementations.
*
Expand Down Expand Up @@ -208,7 +210,11 @@ public void initAuthorizationPluginInstance(IsolatedClassLoader classLoader) {
try (BaseAuthorization<?> authorization =
BaseAuthorization.createAuthorization(classLoader, authorizationProvider)) {
authorizationPlugin =
authorization.newPlugin(entity.namespace().level(0), provider(), this.conf);
classLoader.withClassLoader(
cl ->
authorization.newPlugin(
entity.namespace().level(0), provider(), this.conf));

} catch (Exception e) {
LOG.error("Failed to load authorization with class loader", e);
throw new RuntimeException(e);
Expand Down

0 comments on commit a655913

Please sign in to comment.