This repository was archived by the owner on Aug 11, 2023. It is now read-only.
This repository was archived by the owner on Aug 11, 2023. It is now read-only.
Calling Node.shutdown from a MessageListener throws exception (and doesn't shutdown) #270
Open
Description
(reporting this here as suggested in https://answers.ros.org/question/284838)
What the title says. Looks likely to be a threading problem, since onNewMessage is known to run on a separate thread and the exception happens in a java.util.concurrent primitive.
Using rosjava 0.3.5
Exception in thread "pool-1-thread-13" org.ros.exception.RosRuntimeException: java.lang.InterruptedException
at org.ros.internal.node.client.Registrar.shutdown(Registrar.java:358)
at org.ros.internal.node.DefaultNode.shutdown(DefaultNode.java:426)
at sensei.ros.publishernode.TrackletListener.onNewMessage(TrackletListener.java:76)
at sensei.ros.publishernode.TrackletListener.onNewMessage(TrackletListener.java:28)
at org.ros.internal.transport.queue.MessageDispatcher$1.run(MessageDispatcher.java:125)
at org.ros.internal.transport.queue.MessageDispatcher$1.run(MessageDispatcher.java:122)
at org.ros.concurrent.EventDispatcher.loop(EventDispatcher.java:43)
at org.ros.concurrent.CancellableLoop.run(CancellableLoop.java:56)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1326)
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:277)
at org.ros.concurrent.RetryingExecutorService.shutdown(RetryingExecutorService.java:153)
at org.ros.internal.node.client.Registrar.shutdown(Registrar.java:356)
... 10 more