zbentley opened a new issue #11779:
URL: https://github.com/apache/pulsar/issues/11779


   **Describe the bug**
   If I issue an HTTP DELETE for a tenant which has one or more active 
namespaces, the API docs indicate that I should get either a 405 (`Broker 
doesn't allow forced deletion of tenants`) or a 409 (`The tenant still has 
active namespaces`).
   
   However, I instead get the below stacktrace. 
   
   **To Reproduce**
   1. Start a 2.8.0 broker in standalone configuration.
   2. Create a tenant.
   3. Create a namespace in that tenant, with at least one topic in that 
namespace.
   4. Issue an HTTP DELETE for `tenants/$tenantname`.
   
   **Expected behavior**
   Either a 2xx, 405, or 409 response code is returned.
   
   **Screenshots**
   If applicable, add screenshots to help explain your problem.
   
   **Desktop (please complete the following information):**
    - OS: MacOS 10.11
   
   
   ```
   Response code: 500
   URL: DELETE http://localhost:8080/admin/v2/tenants/chariot2
   Headers: Headers({'host': 'localhost:8080', 'accept': '*/*', 
'accept-encoding': 'gzip, deflate', 'connection': 'keep-alive', 'user-agent': 
'python-httpx/0.18.2'})
   Payload: b''
   
    --- An unexpected error occurred in the server ---
   
   Message: org.apache.pulsar.broker.web.RestException: Tenant has active 
namespace
   
   Stacktrace:
   
   java.util.concurrent.CompletionException: 
org.apache.pulsar.broker.web.RestException: Tenant has active namespace
        at 
java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
        at 
java.base/java.util.concurrent.CompletableFuture.uniAcceptNow(CompletableFuture.java:743)
        at 
java.base/java.util.concurrent.CompletableFuture.uniAcceptStage(CompletableFuture.java:731)
        at 
java.base/java.util.concurrent.CompletableFuture.thenAccept(CompletableFuture.java:2108)
        at 
org.apache.pulsar.broker.admin.impl.TenantsBase.lambda$internalDeleteTenant$20(TenantsBase.java:260)
        at 
java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:680)
        at 
java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:658)
        at 
java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2094)
        at 
org.apache.pulsar.broker.admin.impl.TenantsBase.internalDeleteTenant(TenantsBase.java:255)
        at 
org.apache.pulsar.broker.admin.impl.TenantsBase.internalDeleteTenant(TenantsBase.java:250)
        at 
org.apache.pulsar.broker.admin.impl.TenantsBase.deleteTenant(TenantsBase.java:243)
        at jdk.internal.reflect.GeneratedMethodAccessor226.invoke(Unknown 
Source)
        at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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:124)
        at 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167)
        at 
org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$VoidOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:159)
        at 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)
        at 
org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:475)
        at 
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:397)
        at 
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
        at 
org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255)
        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:234)
        at 
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680)
        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:366)
        at 
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319)
        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:1626)
        at 
org.apache.pulsar.broker.web.ResponseHandlerFilter.doFilter(ResponseHandlerFilter.java:65)
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
        at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
        at 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
        at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1435)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
        at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
        at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
        at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1350)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at 
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:234)
        at 
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
        at 
org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:179)
        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:388)
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380)
        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:383)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:834)
   Caused by: org.apache.pulsar.broker.web.RestException: Tenant has active 
namespace
        at 
org.apache.pulsar.broker.web.PulsarWebResource.lambda$hasActiveNamespace$14(PulsarWebResource.java:969)
        at 
java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:680)
        at 
java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:658)
        at 
java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2094)
        at 
org.apache.pulsar.broker.web.PulsarWebResource.lambda$hasActiveNamespace$16(PulsarWebResource.java:967)
        at 
java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
        at 
java.base/java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:883)
        at 
java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2251)
        at 
org.apache.pulsar.broker.web.PulsarWebResource.lambda$hasActiveNamespace$19(PulsarWebResource.java:952)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
        at 
org.apache.pulsar.broker.web.PulsarWebResource.lambda$hasActiveNamespace$20(PulsarWebResource.java:947)
        at 
java.base/java.util.concurrent.CompletableFuture.uniAcceptNow(CompletableFuture.java:753)
        at 
java.base/java.util.concurrent.CompletableFuture.uniAcceptStage(CompletableFuture.java:731)
        at 
java.base/java.util.concurrent.CompletableFuture.thenAccept(CompletableFuture.java:2108)
        at 
org.apache.pulsar.broker.web.PulsarWebResource.hasActiveNamespace(PulsarWebResource.java:941)
        ... 69 more
   ```


-- 
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-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to