Handle unexpected buildbox-casd termination in asyncio event loop
buildbox-casd
should normally terminate only after BuildStream sends SIGTERM in CASCache._terminate_casd_process()
, which is never be invoked while the asyncio event loop is running. We should thus install an event loop handler to detect unexpected buildbox-casd
termination as early as possible in the main process.
The handler should immediately stop the scheduler and job child processes and report the issue to the user, printing the last log lines of buildbox-casd
and its exit code.