<div class="section" id="automated-zombies">
<span id="index-0"></span><span id="id1"></span>
<p>When <a class="reference internal" href="/wiki/display/ECFLOW/Glossary#term-zombie"><em class="xref std std-term">zombie</em></a> s arise they can be handled manually by <a class="reference internal" href="/wiki/display/ECFLOW/Glossary#term-ecflowview"><em class="xref std std-term">ecflowview</em></a>. (See <a class="reference internal" href="/wiki/display/ECFLOW/Zombie#zombie"><em>Zombie</em></a>)
<strong>or</strong> via the command line interface:</p>
<ul class="simple">
<li>ecflow_client –zombie_get</li>
<li>ecflow_client –zombie_fail <task-path></li>
<li>ecflow_client –zombie_fob <task-path></li>
<li>ecflow_client –zombie_adopt <task-path></li>
<li>ecflow_client –zombie_remove <task-path></li>
<li>ecflow_client –zombie_block <task-path></li>
</ul>
<p>However it is also possible to ask <a class="reference internal" href="/wiki/display/ECFLOW/Glossary#term-ecflow-server"><em class="xref std std-term">ecflow_server</em></a> to make the same response in
an automated fashion. How ever <strong>very</strong> careful consideration should be made before doing this.
Otherwise it could mask a serious underlying problem.</p>
<p>The automated response can be defined with:</p>
<ul>
<li><p class="first">python interface( See <a class="reference internal" href="/wiki/display/ECFLOW/ecFlow+Python+Api#ecflow.ZombieAttr" title="ecflow.ZombieAttr"><tt class="xref py py-class docutils literal"><span class="pre">ecflow.ZombieAttr</span></tt></a>)</p>
</li>
<li><p class="first">text interface ( See <a class="reference internal" href="/wiki/display/ECFLOW/Definition+file+Grammar#grammer"><em>Definition file Grammar</em></a>)</p>
<div class="highlight-python"><pre>zombie ::= "zombie" >> zombie_type >> ":" >> *child >> ":" >> !(client_side_action | server_side_action) >> ":" >> !zombie_life_time
zombie_type ::= "user" | "ecf" | "path"
child ::= "init" | "event" | "meter" | "label" | "wait" | "abort" | "complete"
client_side_action ::= "fob" | "fail" | "block"
server_side_action ::= "adopt" | "delete"
zombie_life_time ::= unsigned integer ( default: user(300), ecf(3600), path(900) )</pre>
</div>
</li>
</ul>
<p>The zombie attribute is inherited in the same manner as <a class="reference internal" href="/wiki/display/ECFLOW/Variable+inheritance#variable-inheritance"><em>Variable inheritance</em></a>.</p>
<p>Example: For tasks under suite “s1” add a zombie attribute, such that child label commands(i.e ecflow_client –label) never block:</p>
<ul>
<li><p class="first">python</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">s1</span> <span class="o">=</span> <span class="n">ecflow</span><span class="o">.</span><span class="n">Suite</span><span class="p">(</span><span class="s">'s1'</span><span class="p">)</span>
<span class="n">child_list</span> <span class="o">=</span> <span class="p">[</span> <span class="n">ChildCmdType</span><span class="o">.</span><span class="n">label</span> <span class="p">]</span>
<span class="n">zombie_attr</span> <span class="o">=</span> <span class="n">ZombieAttr</span><span class="p">(</span><span class="n">ZombieType</span><span class="o">.</span><span class="n">ecf</span><span class="p">,</span> <span class="n">child_list</span><span class="p">,</span> <span class="n">ZombieUserActionType</span><span class="o">.</span><span class="n">fob</span><span class="p">,</span> <span class="mi">300</span><span class="p">)</span>
<span class="n">s1</span><span class="o">.</span><span class="n">add_zombie</span><span class="p">(</span><span class="n">zombie_attr</span><span class="p">)</span>
</pre></div>
</div>
</li>
<li><p class="first">text</p>
<div class="highlight-python"><pre>suite s1
zombie ecf:label:fob:</pre>
</div>
</li>
</ul>
<p>Example: For tasks under suite “s1” add a zombie attribute, such that child commands( event, meter, label) never block:</p>
<ul>
<li><p class="first">python</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">s1</span> <span class="o">=</span> <span class="n">ecflow</span><span class="o">.</span><span class="n">Suite</span><span class="p">(</span><span class="s">'s1'</span><span class="p">)</span>
<span class="n">child_list</span> <span class="o">=</span> <span class="p">[</span> <span class="n">ChildCmdType</span><span class="o">.</span><span class="n">label</span><span class="p">,</span> <span class="n">ChildCmdType</span><span class="o">.</span><span class="n">event</span><span class="p">,</span> <span class="n">ChildCmdType</span><span class="o">.</span><span class="n">meter</span> <span class="p">]</span>
<span class="n">zombie_attr</span> <span class="o">=</span> <span class="n">ZombieAttr</span><span class="p">(</span><span class="n">ZombieType</span><span class="o">.</span><span class="n">ecf</span><span class="p">,</span> <span class="n">child_list</span><span class="p">,</span> <span class="n">ZombieUserActionType</span><span class="o">.</span><span class="n">fob</span><span class="p">,</span> <span class="mi">300</span><span class="p">)</span>
<span class="n">s1</span><span class="o">.</span><span class="n">add_zombie</span><span class="p">(</span><span class="n">zombie_attr</span><span class="p">)</span>
</pre></div>
</div>
</li>
<li><p class="first">text</p>
<div class="highlight-python"><pre>suite s1
zombie ecf:label,event,meter:fob:</pre>
</div>
</li>
</ul>
<p>Example: For all tasks under family “critical”, if any zombies arise then fail the job:</p>
<ul>
<li><p class="first">python</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">with</span> <span class="n">ecflow</span><span class="o">.</span><span class="n">Suite</span><span class="p">(</span><span class="s">'s1'</span><span class="p">)</span> <span class="k">as</span> <span class="n">s1</span><span class="p">:</span>
<span class="k">with</span> <span class="n">s1</span><span class="o">.</span><span class="n">add_family</span><span class="p">(</span><span class="s">"critical"</span><span class="p">)</span> <span class="k">as</span> <span class="n">crit</span> <span class="p">:</span>
<span class="n">child_list</span> <span class="o">=</span> <span class="p">[</span> <span class="p">]</span> <span class="c"># empty child list means apply to all child commands</span>
<span class="n">crit</span><span class="o">.</span><span class="n">add_zombie</span><span class="p">(</span><span class="n">ZombieAttr</span><span class="p">(</span><span class="n">ZombieType</span><span class="o">.</span><span class="n">ecf</span><span class="p">,</span> <span class="n">child_list</span><span class="p">,</span> <span class="n">ZombieUserActionType</span><span class="o">.</span><span class="n">fail</span><span class="p">,</span> <span class="mi">300</span><span class="p">))</span>
<span class="n">crit</span><span class="o">.</span><span class="n">add_zombie</span><span class="p">(</span><span class="n">ZombieAttr</span><span class="p">(</span><span class="n">ZombieType</span><span class="o">.</span><span class="n">path</span><span class="p">,</span> <span class="n">child_list</span><span class="p">,</span> <span class="n">ZombieUserActionType</span><span class="o">.</span><span class="n">fail</span><span class="p">,</span> <span class="mi">300</span><span class="p">))</span>
<span class="n">crit</span><span class="o">.</span><span class="n">add_zombie</span><span class="p">(</span><span class="n">ZombieAttr</span><span class="p">(</span><span class="n">ZombieType</span><span class="o">.</span><span class="n">user</span><span class="p">,</span> <span class="n">child_list</span><span class="p">,</span> <span class="n">ZombieUserActionType</span><span class="o">.</span><span class="n">fail</span><span class="p">,</span> <span class="mi">300</span><span class="p">))</span>
</pre></div>
</div>
</li>
<li><p class="first">text</p>
<div class="highlight-python"><pre>suite s1
family critical
zombie ecf::fail:
zombie path::fail:
zombie user::fail:</pre>
</div>
</li>
</ul>
</div>
|