You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/08/29 17:37:51 UTC

[GitHub] [pulsar] zbentley opened a new issue #11834: 500 error and stacktrace when attempting to terminate a non-persistent topic via the admin API

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: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] zbentley commented on issue #11834: 500 error and stacktrace when attempting to terminate a non-persistent topic via the admin API

Posted by GitBox <gi...@apache.org>.
zbentley commented on issue #11834:
URL: https://github.com/apache/pulsar/issues/11834#issuecomment-919216657


   This works great; a 406 is now returned on attempt to terminate nonpersistent topics.
   
   Thanks for the resolution!


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

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



[GitHub] [pulsar] shibd commented on issue #11834: 500 error and stacktrace when attempting to terminate a non-persistent topic via the admin API

Posted by GitBox <gi...@apache.org>.
shibd commented on issue #11834:
URL: https://github.com/apache/pulsar/issues/11834#issuecomment-916271396


   I think we can 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@pulsar.apache.org

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



[GitHub] [pulsar] tomscut commented on issue #11834: 500 error and stacktrace when attempting to terminate a non-persistent topic via the admin API

Posted by GitBox <gi...@apache.org>.
tomscut commented on issue #11834:
URL: https://github.com/apache/pulsar/issues/11834#issuecomment-916265035


   Hi @shibd @zbentley , has this [#11903](https://github.com/apache/pulsar/pull/11903) solved the problem? Can we close this issue?


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

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



[GitHub] [pulsar] shibd edited a comment on issue #11834: 500 error and stacktrace when attempting to terminate a non-persistent topic via the admin API

Posted by GitBox <gi...@apache.org>.
shibd edited a comment on issue #11834:
URL: https://github.com/apache/pulsar/issues/11834#issuecomment-911224227


   @gaoran10 I can fix it. Please assign to me


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

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



[GitHub] [pulsar] zbentley commented on issue #11834: 500 error and stacktrace when attempting to terminate a non-persistent topic via the admin API

Posted by GitBox <gi...@apache.org>.
zbentley commented on issue #11834:
URL: https://github.com/apache/pulsar/issues/11834#issuecomment-918567964


   @tomscut I will retest this week and close if that fix works.


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

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



[GitHub] [pulsar] gaoran10 commented on issue #11834: 500 error and stacktrace when attempting to terminate a non-persistent topic via the admin API

Posted by GitBox <gi...@apache.org>.
gaoran10 commented on issue #11834:
URL: https://github.com/apache/pulsar/issues/11834#issuecomment-912211364


   @zbentley Yes, if the non-persistent topic doesn't need to support terminate operation, we could add a check and reject the non-persistent topic termination request.


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

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



[GitHub] [pulsar] shibd removed a comment on issue #11834: 500 error and stacktrace when attempting to terminate a non-persistent topic via the admin API

Posted by GitBox <gi...@apache.org>.
shibd removed a comment on issue #11834:
URL: https://github.com/apache/pulsar/issues/11834#issuecomment-911224227


   @gaoran10 I can fix it. Please assign to me


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

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



[GitHub] [pulsar] gaoran10 commented on issue #11834: 500 error and stacktrace when attempting to terminate a non-persistent topic via the admin API

Posted by GitBox <gi...@apache.org>.
gaoran10 commented on issue #11834:
URL: https://github.com/apache/pulsar/issues/11834#issuecomment-907946446


   Currently, I think the non-persistent topic is the lack of the terminating operation, there is a lack of a check to reject the non-persistent topic requests, and we need to add the terminating operation for the non-persistent topic.


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

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



[GitHub] [pulsar] zbentley closed issue #11834: 500 error and stacktrace when attempting to terminate a non-persistent topic via the admin API

Posted by GitBox <gi...@apache.org>.
zbentley closed issue #11834:
URL: https://github.com/apache/pulsar/issues/11834


   


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

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



[GitHub] [pulsar] zbentley commented on issue #11834: 500 error and stacktrace when attempting to terminate a non-persistent topic via the admin API

Posted by GitBox <gi...@apache.org>.
zbentley commented on issue #11834:
URL: https://github.com/apache/pulsar/issues/11834#issuecomment-911839564


   If non-persistent topics don't support termination (totally fine), adding an error code indicating that rather than a 500 and a stacktrace would be preferable.


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

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



[GitHub] [pulsar] shibd commented on issue #11834: 500 error and stacktrace when attempting to terminate a non-persistent topic via the admin API

Posted by GitBox <gi...@apache.org>.
shibd commented on issue #11834:
URL: https://github.com/apache/pulsar/issues/11834#issuecomment-910446209


   @gaoran10  Yes, non persistent topics also need to disconnect all producer links when terminating.
   


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

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



[GitHub] [pulsar] gaoran10 commented on issue #11834: 500 error and stacktrace when attempting to terminate a non-persistent topic via the admin API

Posted by GitBox <gi...@apache.org>.
gaoran10 commented on issue #11834:
URL: https://github.com/apache/pulsar/issues/11834#issuecomment-911064886


   I add a help wanted label first.


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

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



[GitHub] [pulsar] shibd commented on issue #11834: 500 error and stacktrace when attempting to terminate a non-persistent topic via the admin API

Posted by GitBox <gi...@apache.org>.
shibd commented on issue #11834:
URL: https://github.com/apache/pulsar/issues/11834#issuecomment-911224227


   @gaoran10 I can fix it.


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

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