Graceful kill - instruct a paused job to retrieve results

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?

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.

“…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 :slight_smile:

Tried it. Got `Error: Process is unreachable :frowning:

This should fix it

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

Will try. In meantime, please say more :slight_smile:

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 :slight_smile:

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