<h3 dir="auto">Apache Airflow version</h3>
<p dir="auto">2.3.0 (latest released)</p>
<h3 dir="auto">What happened</h3>
<p dir="auto">Lets say we have series of tasks,  currently we executing task B , if the scheduler process gets killed, then worker thats running task B continues to run and  we start the scheduler again and task B was still running because of worker is not killed, then task B would be started for second time with attempt 2, not considering the earlier process.</p>
<h3 dir="auto">What you think should happen instead</h3>
<p dir="auto">when scheduler is killed it should  kill worker process or scheduler is restarted it will should able to link back.</p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">step1. create task that run for long time. here is example with bashoperator.<br>
CUSTOM_JOB = BashOperator(<br>
task_id='CUSTOM_JOB',<br>
bash_command='  for (( i= 1; ; i++)); do    echo "Pres CTRL+C to stop... for $i";    sleep 1;   if [ $i -gt 200 ]; then exit 0; fi; done',<br>
)</p>
<p dir="auto">step 2. make sure airflow scheduler is runing and trigger the dag.</p>
<p dir="auto">step 3. kill the airflow scheduler process in mid way of task execution</p>
<p dir="auto">step 4: start the airflow scheduler back again, now you will be see two instance of task running parallely.</p>
<p dir="auto">it will marked as complete once the task instance scheduled by previous scheduler compeletes.</p>
<p dir="auto">[2022-05-05, 13:50:13 UTC] {subprocess.py:92} INFO - Pres CTRL+C to stop... for 164<br>
[2022-05-05, 13:50:14 UTC] {subprocess.py:92} INFO - Pres CTRL+C to stop... for 165<br>
[2022-05-05, 13:50:14 UTC] {local_task_job.py:220} WARNING - <strong>State of this instance has been externally set to success. Terminating instance.</strong><br>
[2022-05-05, 13:50:14 UTC] {process_utils.py:125} INFO - Sending Signals.SIGTERM to group 9365. PIDs of all processes in the group: [9396, 30772, 9365]</p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">redhat 7.9</p>
<h3 dir="auto">Versions of Apache Airflow Providers</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Deployment</h3>
<p dir="auto">Other</p>
<h3 dir="auto">Deployment details</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Anything else</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Are you willing to submit PR?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Yes I am willing to submit a PR!</li>
</ul>
<h3 dir="auto">Code of Conduct</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li>
</ul>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/apache/airflow/blob/7490c6b8109adcc5aec517fc8d39cfc31912d92f/airflow/www/yarn.lock#L4208-L4211">airflow/airflow/www/yarn.lock</a>
    </p>
    <p class="mb-0 color-fg-muted">
        Lines 4208 to 4211
      in
      <a data-pjax="true" class="commit-tease-sha" href="/apache/airflow/commit/7490c6b8109adcc5aec517fc8d39cfc31912d92f">7490c6b</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L4208" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="4208"></td>
          <td id="LC4208" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-ent">jquery@&gt;=1.7, jquery@&gt;=3.4.0, "jquery@^1.8.3 || ^2.0 || ^3.0"</span>: </td>
        </tr>

        <tr class="border-0">
          <td id="L4209" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="4209"></td>
          <td id="LC4209" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   <span class="pl-s">version "3.4.1"</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L4210" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="4210"></td>
          <td id="LC4210" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   <span class="pl-s">resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2"</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L4211" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="4211"></td>
          <td id="LC4211" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   <span class="pl-s">integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto"><a title="CVE-2020-11023" data-hovercard-type="advisory" data-hovercard-url="/advisories/GHSA-jpcq-cgw6-v4j6/hovercard" href="https://github.com/advisories/GHSA-jpcq-cgw6-v4j6">CVE-2020-11023</a>  <a title="CVE-2020-11022" data-hovercard-type="advisory" data-hovercard-url="/advisories/GHSA-gxr4-xjj5-5px2/hovercard" href="https://github.com/advisories/GHSA-gxr4-xjj5-5px2">CVE-2020-11022</a></p>
<p dir="auto">Recommended upgrade version：3.5.0</p>