Open
Description
If a task is cancelled, sometimes plugin pre-exit hooks are not called. If a pre-exit hook cleans up docker state, or spins down containers, it might not happen causing bad state to persist.
Example log output:
# Received cancellation signal, interrupting
--
| 🚨 Error: Error tearing down bootstrap: The plugin docker-control pre-exit hook exited with status -1
| 2020-03-25 22:42:27 DEBUG Terminating bootstrap after cancellation with terminated
In this case the task exited with status of 255, but the agent was still available. Note that when the task exits with at status code of 1 it looks like the pre-exit hook is successfully called.