diff --git a/compiler/pash_compilation_server.py b/compiler/pash_compilation_server.py index 9d7f6ad0a..65baeb2cb 100644 --- a/compiler/pash_compilation_server.py +++ b/compiler/pash_compilation_server.py @@ -379,6 +379,7 @@ def remove_process(self, process_id): ] ) + assert self.running_procs > 0 self.running_procs -= 1 if self.running_procs == 0: self.unsafe_running = False diff --git a/compiler/pash_runtime.sh b/compiler/pash_runtime.sh index 4bdd0c8a9..e3699ecde 100755 --- a/compiler/pash_runtime.sh +++ b/compiler/pash_runtime.sh @@ -141,7 +141,9 @@ else pash_redir_output echo "$$: (5) BaSh script exited with ec: $pash_runtime_final_status" else function run_parallel() { - trap inform_daemon_exit SIGTERM SIGINT EXIT + # ideally we'd call inform_daemon_exit with the EXIT handler, + # but it isn't called on Ubuntu 20.04 (for no clear reason) + trap inform_daemon_exit SIGTERM SIGINT export SCRIPT_TO_EXECUTE="$pash_script_to_execute" source "$RUNTIME_DIR/pash_restore_state_and_execute.sh" inform_daemon_exit