<div dir="ltr">







<p style="margin:0in"><font face="arial, helvetica, sans-serif">Design proposal for blueprint </font><a href="https://blueprints.launchpad.net/mistral/+spec/mistral-engine-executor-protocol">https://blueprints.launchpad.net/mistral/+spec/mistral-engine-executor-protocol</a></p>
<p style="margin:0in"></p><ul><li><span style="font-family:arial,helvetica,sans-serif">Rename Executor to Worker.</span><br></li><li><span style="font-family:arial,helvetica,sans-serif">Continue to use RPC
     server-client model in oslo.messaging for Engine and Worker protocol.</span><br></li><li><span style="font-family:arial,helvetica,sans-serif">Use asynchronous call (cast)
     between Worker and Engine where appropriate.</span><br></li><li><span style="font-family:arial,helvetica,sans-serif">Remove any DB access from
     Worker.</span><span style="font-family:arial,helvetica,sans-serif">  </span><span style="font-family:arial,helvetica,sans-serif">DB IO will only be done by
     Engine.</span><br></li><li><span style="font-family:arial,helvetica,sans-serif">Worker updates Engine that
     it's going to start running action now.</span><span style="font-family:arial,helvetica,sans-serif"> 
     </span><span style="font-family:arial,helvetica,sans-serif">If execution is not RUNNING and task is not IDLE, Engine tells
     Worker to halt at this point.</span><span style="font-family:arial,helvetica,sans-serif"> 
     </span><span style="font-family:arial,helvetica,sans-serif">Worker cannot assume execution state is RUNNING and task state is
     IDLE because the handle_task message could have been sitting in the
     message queue for awhile.</span><span style="font-family:arial,helvetica,sans-serif">  </span><span style="font-family:arial,helvetica,sans-serif">This call
     between Worker and Engine is synchronous, meaning Worker will wait for a
     response from the Engine.</span><span style="font-family:arial,helvetica,sans-serif"> 
     </span><span style="font-family:arial,helvetica,sans-serif">Currently, Executor checks state and updates task state directly to
     the DB before running the action.</span><br></li><li><span style="font-family:arial,helvetica,sans-serif">Worker communicates result (success or failure) to Engine.</span><span style="font-family:arial,helvetica,sans-serif">  </span><span style="font-family:arial,helvetica,sans-serif">Currently, Executor is inconsistent and calls Engine.convey_task_result
     on success and write directly to DB on failure.</span></li></ul>

<p style="margin:0in"><font face="arial, helvetica, sans-serif">Sequence</font></p><p style="margin:0in"></p><ol><li><span style="font-family:arial,helvetica,sans-serif">Engine ->
     Worker.handle_task</span><br></li><li><span style="font-family:arial,helvetica,sans-serif">Worker converts action spec
     to Action instance</span><br></li><li><span style="font-family:arial,helvetica,sans-serif">Worker ->
     Engine.confirm_task_execution. Engine returns an exception if execution
     state is not RUNNING or task state is not IDLE.</span><br></li><li><span style="font-family:arial,helvetica,sans-serif">Worker runs action</span><br></li><li><span style="font-family:arial,helvetica,sans-serif">Worker ->
     Engine.convey_task_result</span><br></li></ol><div><font face="arial, helvetica, sans-serif">Please provide feedback.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Thanks.</font></div>
<div><font face="arial, helvetica, sans-serif">Winson</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><p></p>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 6, 2014 at 9:12 AM, 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">Renat,<div><br></div><div>Regarding blueprint <a href="https://blueprints.launchpad.net/mistral/+spec/mistral-engine-executor-protocol" target="_blank">https://blueprints.launchpad.net/mistral/+spec/mistral-engine-executor-protocol</a>, can you clarify what it means by worker <span style="color:rgb(51,51,51);font-family:sans-serif;font-size:12px;line-height:18px">parallelism</span> and engine-executor <span style="color:rgb(51,51,51);font-family:sans-serif;font-size:12px;line-height:18px">parallelism?  Currently, the engine and executor are launched with the eventlet driver in oslo.messaging.  Once a message arrives over transport, a new green thread is spawned and passed to the dispatcher.  In the case of executor, the function being dispatched to is handle_task.  I'm unclear what additional parallelism this blueprint is referring to.  The context isn't clear from the summit notes.</span></div>

<div><span style="color:rgb(51,51,51);font-family:sans-serif;font-size:12px;line-height:18px"><br></span></div><div><span style="color:rgb(51,51,51);font-family:sans-serif;font-size:12px;line-height:18px">Thanks.</span></div>

<div><span style="color:rgb(51,51,51);font-family:sans-serif;font-size:12px;line-height:18px">Winson</span></div>
</div>
</blockquote></div><br></div>