# Graceful kill - instruct a paused job to retrieve results

**URL:** <https://aiida.discourse.group/t/graceful-kill-instruct-a-paused-job-to-retrieve-results/177>\
**Category:** General Usage\
**Tags:** question\
**Created:** [November 27, 2023, 9:21am UTC](https://aiida.discourse.group/t/graceful-kill-instruct-a-paused-job-to-retrieve-results/177 "2023-11-27T09:21:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![edan-bainglass](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/edan-bainglass/32/15_2.png) [@edan-bainglass](https://aiida.discourse.group/u/edan-bainglass)\
**Post date:** [November 27, 2023, 9:21am UTC](https://aiida.discourse.group/t/graceful-kill-instruct-a-paused-job-to-retrieve-results/177/1 "2023-11-27T09:21:44Z")

</div>

Is there a way to gracefully kill a process? I’d like to kill a paused job to trigger retrieval of results. In my case, the calculation is no longer running. However, AiiDA ran into what I think are network issues and got stuck (max 5 attempts). The calculation did produce results though. How can I instruct AiiDA to terminate the process and attempt to retrieve the data?

---

<div class="post-metadata">

**Author:** ![giovannipizzi](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/giovannipizzi/32/17_2.png) [@giovannipizzi](https://aiida.discourse.group/u/giovannipizzi)\
**Post date:** [November 27, 2023, 9:39am UTC](https://aiida.discourse.group/t/graceful-kill-instruct-a-paused-job-to-retrieve-results/177/2 "2023-11-27T09:39:29Z")

</div>

In your case, do you really want to “kill” it? If it’s not really running, if you just replay it, wouldn’t this be enough? In this case, AiiDA will check the queue, discover it’s not running, and then retrieve data.

---

<div class="post-metadata">

**Author:** ![edan-bainglass](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/edan-bainglass/32/15_2.png) [@edan-bainglass](https://aiida.discourse.group/u/edan-bainglass)\
**Post date:** [November 27, 2023, 9:47am UTC](https://aiida.discourse.group/t/graceful-kill-instruct-a-paused-job-to-retrieve-results/177/3 "2023-11-27T09:47:24Z")

</div>

“…will check the queue, discover it’s not running, and then retrieve data” is what I was meaning by “graceful kill”. “kill” not accurate though. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![edan-bainglass](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/edan-bainglass/32/15_2.png) [@edan-bainglass](https://aiida.discourse.group/u/edan-bainglass)\
**Post date:** [November 27, 2023, 9:59am UTC](https://aiida.discourse.group/t/graceful-kill-instruct-a-paused-job-to-retrieve-results/177/4 "2023-11-27T09:59:06Z")

</div>

Tried it. Got `Error: Process is unreachable ☹

---

<div class="post-metadata">

**Author:** ![sphuber](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/sphuber/32/6_2.png) [@sphuber](https://aiida.discourse.group/u/sphuber)\
**Post date:** [November 27, 2023, 10:01am UTC](https://aiida.discourse.group/t/graceful-kill-instruct-a-paused-job-to-retrieve-results/177/5 "2023-11-27T10:01:54Z")

</div>

This should fix it

```auto
verdi daemon stop
verdi devel rabbitmq tasks analyze --fix
verdi daemon start
# Now wait a bit (depends on how many active procs you have) but couple seconds
verdi process play PK

```

---

<div class="post-metadata">

**Author:** ![edan-bainglass](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/edan-bainglass/32/15_2.png) [@edan-bainglass](https://aiida.discourse.group/u/edan-bainglass)\
**Post date:** [November 27, 2023, 10:29am UTC](https://aiida.discourse.group/t/graceful-kill-instruct-a-paused-job-to-retrieve-results/177/6 "2023-11-27T10:29:20Z")

</div>

Will try. In meantime, please say more 🙂

---

<div class="post-metadata">

**Author:** ![edan-bainglass](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/edan-bainglass/32/15_2.png) [@edan-bainglass](https://aiida.discourse.group/u/edan-bainglass)\
**Post date:** [November 29, 2023, 2:03pm UTC](https://aiida.discourse.group/t/graceful-kill-instruct-a-paused-job-to-retrieve-results/177/7 "2023-11-29T14:03:57Z")

</div>

I got

“Warning: There are active processes without process task: …”

After the warning, it revived many other pks.

In any case, this helped. I was able to replay the jobs triggering retrieval.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![sphuber](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/sphuber/32/6_2.png) [@sphuber](https://aiida.discourse.group/u/sphuber)\
**Post date:** [November 29, 2023, 2:35pm UTC](https://aiida.discourse.group/t/graceful-kill-instruct-a-paused-job-to-retrieve-results/177/8 "2023-11-29T14:35:33Z")

</div>

Well reviving the lost tasks is exactly its purpose, so the warning makes sense 🙂 glad it worked
