<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-family:arial,sans-serif;font-size:13px">In case of async tasks, executor keeps the task status at RUNNING, and a 3rd party system will call convey_task_resutls on engine.</span></blockquote>
<div><br></div><div>Yes, it is correct.  With this approach (in case sync task), we set task state to SUCCESS if it returns a result, or ERROR if we can't see a result and exception is raised.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span style="font-family:arial,sans-serif;font-size:13px"> It is a bug and should be done before line 119:  </span><span style="color:rgb(153,153,153);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">self</span><span style="font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">.</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">_do_task_action</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">(</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">db_task</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">)</span><span style="font-family:arial,sans-serif;font-size:13px">.</span></blockquote>
<div><br></div><div>And also lines 120-123 (<a href="https://github.com/stackforge/mistral/blob/master/mistral/engine/scalable/executor/server.py#L120-L123">https://github.com/stackforge/mistral/blob/master/mistral/engine/scalable/executor/server.py#L120-L123</a>) are incorrect since in _do_task_action updates the task state. But we have two different types of task (async, sync) and I think we should update task state to RUNNING before invoking _do_task_action and remove this lines - <a href="https://github.com/stackforge/mistral/blob/master/mistral/engine/scalable/executor/server.py#L58-L61">https://github.com/stackforge/mistral/blob/master/mistral/engine/scalable/executor/server.py#L58-L61</a>.</div>
<div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 27, 2014 at 9:47 AM, Manas Kelshikar <span dir="ltr"><<a href="mailto:manas@stackstorm.com" target="_blank">manas@stackstorm.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes. It is a bug and should be done before line 119:  <span style="color:rgb(153,153,153);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">self</span><span style="font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">.</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">_do_task_action</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">(</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">db_task</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">)</span>. It can definitely lead to bugs especially since _do_task_action itself updates the status.<div>

<div><br></div><div><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 26, 2014 at 8:46 PM, W Chan <span dir="ltr"><<a href="mailto:m4d.coder@gmail.com" target="_blank">m4d.coder@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">In addition, for sync tasks, it'll overwrite the task state from SUCCESS to RUNNING.</div><div>
<div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 26, 2014 at 8:41 PM, Dmitri Zimine <span dir="ltr"><<a href="mailto:dz@stackstorm.com" target="_blank">dz@stackstorm.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">My understanding is: it's the engine which finalizes the task results, based on the status returned by the task via convey_task_result call. <div>


<br></div><div><a href="https://github.com/stackforge/mistral/blob/master/mistral/engine/abstract_engine.py#L82-L84" target="_blank">https://github.com/stackforge/mistral/blob/master/mistral/engine/abstract_engine.py#L82-L84</a></div>


<div><a href="https://github.com/stackforge/mistral/blob/master/mistral/engine/scalable/executor/server.py#L44-L66" target="_blank">https://github.com/stackforge/mistral/blob/master/mistral/engine/scalable/executor/server.py#L44-L66</a></div>


<div><br></div><div>In case of async tasks, executor keeps the task status at RUNNING, and a 3rd party system will call convey_task_resutls on engine. </div><div><br></div><div><blockquote type="cite"><div dir="ltr"><a href="https://github.com/stackforge/mistral/blob/master/mistral/engine/scalable/executor/server.py#L123" target="_blank">https://github.com/stackforge/mistral/blob/master/mistral/engine/scalable/executor/server.py#L123</a>,</div>


</blockquote><br></div><div>This line however looks like a bug to me:  at best it doesnt do much and at worst it overwrites the ERROR previously set in here <span style="white-space:pre-wrap"><a href="http://tinyurl.com/q5lps2h" target="_blank">http://tinyurl.com/q5lps2h</a> </span></div>


<div><br></div><div>Nicolay, any better explanation?</div><div><br></div><div><br></div><div>DZ> </div><div><div><br><div><div><div><div>On Mar 26, 2014, at 6:20 PM, W Chan <<a href="mailto:m4d.coder@gmail.com" target="_blank">m4d.coder@gmail.com</a>> wrote:</div>


<br></div></div><blockquote type="cite"><div><div><div dir="ltr"><div>Regarding <a href="https://github.com/stackforge/mistral/blob/master/mistral/engine/scalable/executor/server.py#L123" target="_blank">https://github.com/stackforge/mistral/blob/master/mistral/engine/scalable/executor/server.py#L123</a>, should the status be set to SUCCESS instead of RUNNING?  If not, can someone clarify why the task should remain RUNNING?</div>



<div><br></div><div>Thanks.</div><div>Winson</div><div><br></div></div></div></div>
_______________________________________________<br>OpenStack-dev mailing list<br><a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>


</blockquote></div><br></div></div></div><br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><font>Best Regards,</font></div><div><font>Nikolay</font></div></div>
</div>