Dale LaBossiere created EDGENT-404:
--------------------------------------
Summary: Sending a start-app control cmd to a started app needs to
be improved
Key: EDGENT-404
URL: https://issues.apache.org/jira/browse/EDGENT-404
Project: Edgent
Issue Type: Bug
Components: Providers
Reporter: Dale LaBossiere
Sending a stopApp edgentControl cmd to a stopped app isn't too bad. The app
receives the request and logs an entry like:
{code}
Mar 29, 2017 4:47:14 PM
org.apache.edgent.runtime.jsoncontrol.JsonControlService controlOperation
WARNING: Unable to find mbean for control id: job:face-detect
{code}
Sending a startApp control cmd to a started app isn't so great. At least in
the case of my app it kept running fine, but that seems to be because its
topologyBuilder didn't do anything that upset a running topology - e.g.,
there's no shared state that was reset or such.
i.e., Edgent went as far as invoking the registered topologyBuider again and
then encountered problems when it was trying to submit the newly built topology
and logged a SEVERE traceback:
{code}
SEVERE: Control request failed:
{"device":"D/osx/mbp1","command":"edgentControl","tsms":1490820506568,"format":"json","payload":{"type":"appService","alias":"edgent","op":"submit","args":["face-detect",{}]}}
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.apache.edgent.runtime.jsoncontrol.JsonControlService.executeMethod(JsonControlService.java:246)
at
org.apache.edgent.runtime.jsoncontrol.JsonControlService.controlOperation(JsonControlService.java:185)
at
org.apache.edgent.runtime.jsoncontrol.JsonControlService.controlRequest(JsonControlService.java:100)
at
org.apache.edgent.providers.iot.IotProvider.lambda$null$9f4ce4e9$1(IotProvider.java:314)
at
org.apache.edgent.function.Functions$ThreadSafeConsumer.accept(Functions.java:204)
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.Pipe.submit(Pipe.java:65)
at org.apache.edgent.oplet.plumbing.Isolate.run(Isolate.java:86)
at
org.apache.edgent.oplet.plumbing.Isolate.lambda$initialize$0(Isolate.java:64)
at
org.apache.edgent.runtime.etiao.ThreadFactoryTracker$2.run(ThreadFactoryTracker.java:87)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Cannot register job control for
alias face-detect because a job control with id job:face-detect for the same
alias already exists and is not CLOSED
at
org.apache.edgent.runtime.etiao.mbeans.EtiaoJobBean.registerControl(EtiaoJobBean.java:140)
at
org.apache.edgent.runtime.etiao.mbeans.EtiaoJobBean.registerControl(EtiaoJobBean.java:60)
at org.apache.edgent.runtime.etiao.EtiaoJob.<init>(EtiaoJob.java:72)
at
org.apache.edgent.runtime.etiao.Executable.createJob(Executable.java:270)
at
org.apache.edgent.providers.direct.DirectTopology.executeCallable(DirectTopology.java:104)
at
org.apache.edgent.providers.direct.DirectProvider.submit(DirectProvider.java:88)
at
org.apache.edgent.providers.direct.DirectProvider.submit(DirectProvider.java:52)
at
org.apache.edgent.providers.iot.IotProvider.submit(IotProvider.java:228)
at
org.apache.edgent.providers.iot.IotProvider.submit(IotProvider.java:93)
at
org.apache.edgent.runtime.appservice.AppServiceControl.submit(AppServiceControl.java:65)
... 18 more
{code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)