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


   **Describe the bug**
   When I attempt to POST `/terminate` to a non-partitioned, non-persistent 
topic, I recieve a 500 error and a stacktrace starting with `class 
org.apache.pulsar.broker.service.nonpersistent.NonPersistentTopic cannot be 
cast to class org.apache.pulsar.broker.service.persistent.PersistentTopic`.
   
   The full stacktrace and HTTP logs from my client are at the bottom of this 
issue.
   
   **To Reproduce**
   1. Ensure broker 2.8.0 is running (I used standalone).
   2. Create a non-persistent, non-partitioned topic.
   3. POST to its `/terminate` endpoint.
   4. See error.
   
   **Expected behavior**
   Topic is terminated successfully; a 2xx response code is returned.
   
   
   **Desktop (please complete the following information):**
    - OS: MacOS 10.11.
   
   **Stacktrace and HTTP logs**
   
   ```
   E           chariot.pulsar.client.exceptions.PulsarAPIError: 500 Server 
Error: Internal Server Error for url: 
http://localhost:8080/admin/v2/non-persistent/chariot-test-obj-Tenant-59-pxMR/chariot-test-obj-Namespace-60-KXYa/chariot-test-obj-Topic-61-xkRL_no_partitions_transient/terminate
   E           Response code: 500
   E           URL: POST 
http://localhost:8080/admin/v2/non-persistent/chariot-test-obj-Tenant-59-pxMR/chariot-test-obj-Namespace-60-KXYa/chariot-test-obj-Topic-61-xkRL_no_partitions_transient/terminate
   E           Headers: Headers({'host': 'localhost:8080', 'content-length': 
'0', 'accept': '*/*', 'accept-encoding': 'gzip, deflate', 'connection': 
'keep-alive', 'user-agent': 'python-httpx/0.18.2'})
   E           Payload: b''
   E
   E            --- An unexpected error occurred in the server ---
   E
   E           Message: class 
org.apache.pulsar.broker.service.nonpersistent.NonPersistentTopic cannot be 
cast to class org.apache.pulsar.broker.service.persistent.PersistentTopic 
(org.apache.pulsar.broker.service.nonpersistent.NonPersistentTopic and 
org.apache.pulsar.broker.service.persistent.PersistentTopic are in unnamed 
module of loader 'app')
   E
   E           Stacktrace:
   E
   E           java.lang.ClassCastException: class 
org.apache.pulsar.broker.service.nonpersistent.NonPersistentTopic cannot be 
cast to class org.apache.pulsar.broker.service.persistent.PersistentTopic 
(org.apache.pulsar.broker.service.nonpersistent.NonPersistentTopic and 
org.apache.pulsar.broker.service.persistent.PersistentTopic are in unnamed 
module of loader 'app')
   E            at 
org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalTerminate(PersistentTopicsBase.java:2913)
   E            at 
org.apache.pulsar.broker.admin.v2.PersistentTopics.terminate(PersistentTopics.java:2307)
   E            at 
jdk.internal.reflect.GeneratedMethodAccessor255.invoke(Unknown Source)
   E            at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   E            at java.base/java.lang.reflect.Method.invoke(Method.java:566)
   E            at 
org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
   E            at 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124)
   E            at 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167)
   E            at 
org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:219)
   E            at 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)
   E            at 
org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:475)
   E            at 
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:397)
   E            at 
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
   E            at 
org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255)
   E            at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
   E            at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
   E            at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
   E            at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
   E            at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
   E            at 
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
   E            at 
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234)
   E            at 
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680)
   E            at 
org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
   E            at 
org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
   E            at 
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366)
   E            at 
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319)
   E            at 
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
   E            at 
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
   E            at 
org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1626)
   E            at 
org.apache.pulsar.broker.web.ResponseHandlerFilter.doFilter(ResponseHandlerFilter.java:65)
   E            at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
   E            at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
   E            at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
   E            at 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
   E            at 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
   E            at 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
   E            at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1435)
   E            at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
   E            at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
   E            at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
   E            at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
   E            at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1350)
   E            at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
   E            at 
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:234)
   E            at 
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
   E            at 
org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:179)
   E            at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
   E            at org.eclipse.jetty.server.Server.handle(Server.java:516)
   E            at 
org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388)
   E            at 
org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633)
   E            at 
org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380)
   E            at 
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
   E            at 
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
   E            at 
org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
   E            at 
org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
   E            at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
   E            at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
   E            at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
   E            at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
   E            at 
org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:383)
   E            at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
   E            at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
   E            at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
   E            at java.base/java.lang.Thread.run(Thread.java:834)
   ```


-- 
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]


Reply via email to