You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "yuqi1129 (via GitHub)" <gi...@apache.org> on 2026/06/03 09:25:49 UTC
[I] [Bug report] dropCatalog may fail when catalog cache returns a closed wrapper [gravitino]
yuqi1129 opened a new issue, #11406:
URL: https://github.com/apache/gravitino/issues/11406
### Version
main branch
### Describe what's wrong
`dropCatalog` can fail when `loadCatalogAndWrap` returns a cached `CatalogWrapper` whose underlying catalog has already been closed by cache invalidation/removal handling. In that state, `CatalogWrapper.catalog()` returns null and drop paths can throw a NullPointerException instead of reloading the catalog from the entity store.
### Error message and/or stacktrace
Cannot invoke "org.apache.gravitino.connector.BaseCatalog.capability()" because "this.catalog" is null
Observed from CI:
```text
CatalogIT > testCreateCatalogWithoutProperties() FAILED
java.lang.RuntimeException: Failed to operate object [...] operation [DROP] ..., reason [Cannot invoke "org.apache.gravitino.connector.BaseCatalog.capability()" because "this.catalog" is null]
```
### How to reproduce
A minimal unit reproduction is to cache a `CatalogWrapper`, close it, put it back into the cache, and then call `dropCatalog`. The current implementation reuses the closed wrapper and fails with a NullPointerException.
### Additional context
`CatalogWrapper.close()` sets the wrapped catalog to null. `loadCatalogAndWrap` should defensively invalidate and reload if the cached wrapper has already been closed.
--
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: commits-unsubscribe@gravitino.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug report] dropCatalog may fail when catalog cache returns a closed wrapper [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 closed issue #11406: [Bug report] dropCatalog may fail when catalog cache returns a closed wrapper
URL: https://github.com/apache/gravitino/issues/11406
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug report] dropCatalog may fail when catalog cache returns a closed wrapper [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on issue #11406:
URL: https://github.com/apache/gravitino/issues/11406#issuecomment-4611013650
The real problem can be seen here: https://github.com/apache/gravitino/actions/runs/26870649551/job/79245397139
```text
CatalogIT > testCreateCatalogWithoutProperties() FAILED
java.lang.RuntimeException: Failed to operate object [catalog_0c96cf2e] operation [DROP] under [catalog_it_metalake_82f9f2b0], reason [Cannot invoke "org.apache.gravitino.connector.BaseCatalog.capability()" because "this.catalog" is null]
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke "org.apache.gravitino.connector.BaseCatalog.capability()" because "this.catalog" is null
at org.apache.gravitino.catalog.CatalogManager.lambda$dropCatalog$24(CatalogManager.java:904)
at org.apache.gravitino.lock.TreeLockUtils.doWithTreeLock(TreeLockUtils.java:49)
at org.apache.gravitino.catalog.CatalogManager.dropCatalog(CatalogManager.java:850)
at org.apache.gravitino.catalog.CatalogNormalizeDispatcher.dropCatalog(CatalogNormalizeDispatcher.java:112)
at org.apache.gravitino.listener.CatalogEventDispatcher.dropCatalog(CatalogEventDispatcher.java:183)
at org.apache.gravitino.hook.CatalogHookDispatcher.dropCatalog(CatalogHookDispatcher.java:156)
at org.apache.gravitino.server.web.rest.CatalogOperations.lambda$dropCatalog$7(CatalogOperations.java:338)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
at java.base/javax.security.auth.Subject.doAs(Subject.java:439)
at org.apache.gravitino.utils.PrincipalUtils.doAs(PrincipalUtils.java:53)
at org.apache.gravitino.server.web.Utils.doAs(Utils.java:209)
at org.apache.gravitino.server.web.rest.CatalogOperations.dropCatalog(CatalogOperations.java:334)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:146)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:189)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:93)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:256)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:235)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:358)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:311)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1656)
at org.apache.gravitino.server.authentication.AuthenticationFilter.lambda$doFilter$0(AuthenticationFilter.java:96)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
at java.base/javax.security.auth.Subject.doAs(Subject.java:439)
at org.apache.gravitino.utils.PrincipalUtils.doAs(PrincipalUtils.java:53)
at org.apache.gravitino.server.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:93)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
at org.apache.gravitino.server.web.VersioningFilter.doFilter(VersioningFilter.java:111)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
at org.apache.gravitino.server.web.RequestContextFilter.doFilter(RequestContextFilter.java:59)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:552)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:516)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke "org.apache.gravitino.connector.BaseCatalog.capability()" because "this.catalog" is null
at org.apache.gravitino.catalog.CatalogManager.isManagedStorageCatalog(CatalogManager.java:1023)
at org.apache.gravitino.catalog.CatalogManager.lambda$dropCatalog$24(CatalogManager.java:872)
... 78 more
Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.gravitino.connector.BaseCatalog.capability()" because "this.catalog" is null
at org.apache.gravitino.catalog.CatalogManager$CatalogWrapper.lambda$capabilities$11(CatalogManager.java:242)
at org.apache.gravitino.utils.IsolatedClassLoader.withClassLoader(IsolatedClassLoader.java:86)
at org.apache.gravitino.catalog.CatalogManager$CatalogWrapper.capabilities(CatalogManager.java:242)
at org.apache.gravitino.catalog.CatalogManager.isManagedStorageCatalog(CatalogManager.java:1016)
... 79 more
at org.apache.gravitino.client.ErrorHandlers$CatalogErrorHandler.accept(ErrorHandlers.java:581)
at org.apache.gravitino.client.ErrorHandlers$CatalogErrorHandler.accept(ErrorHandlers.java:550)
at org.apache.gravitino.client.HTTPClient.throwFailure(HTTPClient.java:236)
at org.apache.gravitino.client.HTTPClient.execute(HTTPClient.java:388)
at org.apache.gravitino.client.HTTPClient.execute(HTTPClient.java:296
```
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org