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 2020/07/02 19:08:03 UTC

[GitHub] [pulsar] epsteina16 opened a new issue #7437: Pulsar Admin Java Client leaves hanging thread after close called

epsteina16 opened a new issue #7437:
URL: https://github.com/apache/pulsar/issues/7437


   **Describe the bug**
   After closing a Java pulsar admin instance, a delayer thread is left hanging in the background in a TIMED_WAITING state that can prevent the parent program from ending.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. Create a pulsar admin instance.
   2. Add a new topic using the pulsar admin.
   3. Close the pulsar admin.
   4. Do a java thread dump to see the hanging delayer thread.
   
   **Expected behavior**
   Calling close should free and end all threads created by the PulsarAdmin. This includes all AsyncHttp related threads.
   
   **Desktop (please complete the following information):**
   - Linux


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

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



[GitHub] [pulsar] rushsky518 commented on issue #7437: Pulsar Admin Java Client leaves hanging thread after close called

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


   i'd like to make a contribution @BewareMyPower


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

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



[GitHub] [pulsar] merlimat closed issue #7437: Pulsar Admin Java Client leaves hanging thread after close called

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


   


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

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



[GitHub] [pulsar] BewareMyPower commented on issue #7437: Pulsar Admin Java Client leaves hanging thread after close called

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


   The reason is executors that were created by `delayer` to run timeout task were still running. Changing these threads to daemon is a way to solve the problem. Calling `delayer.shutdownNow()` in `AsyncHttpConnector.close()` method also works.
   
   Would you like to push a PR? @rushsky518 


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

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



[GitHub] [pulsar] rushsky518 commented on issue #7437: Pulsar Admin Java Client leaves hanging thread after close called

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


   in `org.apache.pulsar.client.admin.internal.http.AsyncHttpConnector`
   set daemon = true can solve this problem?
   ```java
       private final ScheduledExecutorService delayer = Executors.newScheduledThreadPool(1,
               new DefaultThreadFactory("delayer", true));
   ````


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

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