ow2-proactive / scheduling

Multi-platform Scheduling and Workflows Engine
http://www.activeeon.com/workflows-scheduling
GNU Affero General Public License v3.0
62 stars 55 forks source link

Paused task cannot be restarted #2289

Open sandrineBeauche opened 9 years ago

sandrineBeauche commented 9 years ago

When restarting a paused task, we obtain this error on the interactive client

An error occurred while attempting to restart task('HelloWorld'): Error Message: HTTP 500 Internal Server Error Stack Track: javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.handleErrorStatus(ClientInvocation.java:189) at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:154) at org.jboss.resteasy.client.jaxrs.internal.proxy.extractors.BodyEntityExtractor.extractEntity(BodyEntityExtractor.java:58) at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:104) at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:62) at com.sun.proxy.$Proxy31.restartTask(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.ow2.proactive_grid_cloud_portal.scheduler.client.SchedulerRestClient$RestClientExceptionHandler.invoke(SchedulerRestCli at com.sun.proxy.$Proxy31.restartTask(Unknown Source) at org.ow2.proactive_grid_cloud_portal.cli.cmd.sched.RestartTaskCommand.execute(RestartTaskCommand.java:58) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at sun.org.mozilla.javascript.internal.MemberBox.invoke(MemberBox.java:167) at sun.org.mozilla.javascript.internal.NativeJavaMethod.call(NativeJavaMethod.java:245) at sun.org.mozilla.javascript.internal.Interpreter.interpretLoop(Interpreter.java:1706) at sun.org.mozilla.javascript.internal.Interpreter.interpret(Interpreter.java:849) at sun.org.mozilla.javascript.internal.InterpretedFunction.call(InterpretedFunction.java:162) at sun.org.mozilla.javascript.internal.ContextFactory.doTopCall(ContextFactory.java:429) at com.sun.script.javascript.RhinoScriptEngine$1.superDoTopCall(RhinoScriptEngine.java:116) at com.sun.script.javascript.RhinoScriptEngine$1.doTopCall(RhinoScriptEngine.java:109) at sun.org.mozilla.javascript.internal.ScriptRuntime.doTopCall(ScriptRuntime.java:3161) at sun.org.mozilla.javascript.internal.InterpretedFunction.exec(InterpretedFunction.java:173) at sun.org.mozilla.javascript.internal.Context.evaluateReader(Context.java:1159) at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:214) at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:240) at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264) at org.ow2.proactive_grid_cloud_portal.cli.cmd.AbstractIModeCommand.execute(AbstractIModeCommand.java:75) at org.ow2.proactive_grid_cloud_portal.cli.EntryPoint.executeCommandList(EntryPoint.java:156) at org.ow2.proactive_grid_cloud_portal.cli.EntryPoint.run(EntryPoint.java:119) at org.ow2.proactive_grid_cloud_portal.cli.CommonEntryPoint.main(CommonEntryPoint.java:51)

lpellegr commented 9 years ago

Based on the source code, it seems that a task can be restarted if it is in one of the following states:

I tried the RUNNING state with a Python task sleeping for 60 seconds and with maxNumberOfExecution set to at least 2:

import time
time.sleep(60)

In that case a restart with ./bin/proactive-client -rt JOB_ID "Python_Task" seems to work.

If the maxNumberOfExecution is set to a lower value, then proactive-client reports that the restart has succeeded but the task fails.

The same test for restarting a task in a PAUSED state seems not to work.

Also, the proactive-client help command speaks about a delay parameter that cannot be set using the utility.

To summarize, the usage is not well documented and some cases seem not to work.