You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@edgent.apache.org by "Dale LaBossiere (JIRA)" <ji...@apache.org> on 2017/03/28 14:27:43 UTC

[jira] [Created] (EDGENT-402) App doesn't stop cleanly

Dale LaBossiere created EDGENT-402:
--------------------------------------

             Summary: App doesn't stop cleanly
                 Key: EDGENT-402
                 URL: https://issues.apache.org/jira/browse/EDGENT-402
             Project: Edgent
          Issue Type: Bug
          Components: Runtime
            Reporter: Dale LaBossiere


I had an IotProvider based app that upon receiving a "stop application" edgentControl command did stop, and could subsequently be restarted ok, but shutdown with Severe log entries.

It appears that the PeriodicSource oplet's run() terminated due to a presumably-job-close-induced interrupted exception and that exception was then propagated as a runtime exception and caught an reported by the java executor.

Perhaps some additional exception "filtering" should be done by oplets run() if interrupted-exception means "stop"?

Or maybe the problem was with behavior of the Isolate at the end of the pipeline and its behavior after getting an interrupted exception waiting on its blocking queue?  

In the traceback below my app code generates up to the flatMap.  After that it's a result of using IotProvider generated (PubSub) IotDevice.events() to publish the tuples from the flatMap.

{code}
poll() -> filter() -> map() -> peek() -> flatMap() -> [IotDevice.events() map() -> events -> isolate ]
{code}

{code}
Mar 27, 2017 2:56:10 PM org.apache.edgent.runtime.etiao.TrackingScheduledExecutor afterExecute
SEVERE: Thread: pool-4-thread-70-face-detect: task terminated with exception : 
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.InterruptedException
	at org.apache.edgent.oplet.core.PeriodicSource.run(PeriodicSource.java:83)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at org.apache.edgent.runtime.etiao.TrackingScheduledExecutor$TrackedFuture.run(TrackingScheduledExecutor.java:205)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.edgent.runtime.etiao.ThreadFactoryTracker$2.run(ThreadFactoryTracker.java:87)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: java.lang.InterruptedException
	at org.apache.edgent.oplet.plumbing.Isolate.accept(Isolate.java:79)
	at org.apache.edgent.runtime.etiao.SettableForwarder.accept(SettableForwarder.java:54)
	at org.apache.edgent.oplet.core.Source.submit(Source.java:47)
	at org.apache.edgent.oplet.functional.Events.accept(Events.java:78)
	at org.apache.edgent.connectors.pubsub.service.TopicHandler.accept(TopicHandler.java:47)
	at org.apache.edgent.runtime.etiao.SettableForwarder.accept(SettableForwarder.java:54)
	at org.apache.edgent.oplet.core.Pipe.submit(Pipe.java:65)
	at org.apache.edgent.oplet.functional.Map.accept(Map.java:47)
	at org.apache.edgent.runtime.etiao.SettableForwarder.accept(SettableForwarder.java:54)
	at org.apache.edgent.oplet.core.Pipe.submit(Pipe.java:65)
	at org.apache.edgent.oplet.functional.FlatMap.accept(FlatMap.java:57)
	at org.apache.edgent.runtime.etiao.SettableForwarder.accept(SettableForwarder.java:54)
	at org.apache.edgent.oplet.core.Pipe.submit(Pipe.java:65)
	at org.apache.edgent.oplet.core.Peek.accept(Peek.java:38)
	at org.apache.edgent.runtime.etiao.SettableForwarder.accept(SettableForwarder.java:54)
	at org.apache.edgent.oplet.core.Pipe.submit(Pipe.java:65)
	at org.apache.edgent.oplet.functional.Map.accept(Map.java:47)
	at org.apache.edgent.runtime.etiao.SettableForwarder.accept(SettableForwarder.java:54)
	at org.apache.edgent.oplet.core.Pipe.submit(Pipe.java:65)
	at org.apache.edgent.oplet.functional.Filter.accept(Filter.java:37)
	at org.apache.edgent.runtime.etiao.SettableForwarder.accept(SettableForwarder.java:54)
	at org.apache.edgent.oplet.core.Source.submit(Source.java:47)
	at org.apache.edgent.oplet.functional.SupplierPeriodicSource.fetchTuples(SupplierPeriodicSource.java:52)
	at org.apache.edgent.oplet.core.PeriodicSource.run(PeriodicSource.java:81)
	... 9 more
Caused by: java.lang.InterruptedException
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1220)
	at java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:335)
	at java.util.concurrent.LinkedBlockingQueue.put(LinkedBlockingQueue.java:339)
	at org.apache.edgent.oplet.plumbing.Isolate.accept(Isolate.java:76)
	... 32 more
{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)