Signal Handlerとは?
signal handlerは、kernelが特定のsignalを配送したときに非同期に呼び出されるよう、プロセスがインストールするコードの一部です。signalが届くと通常の実行が中断され、handlerが実行され、その後通常は制御が再開します。handlerにより、プログラムは突然終了するのではなく、後始末をしたり設定を再読み込みしたり、正常にシャットダウンしたりできます。
なぜ重要か
終了signalを捕捉するhandlerがあれば、CI jobは終了前にログをflushし一時ファイルを削除できます。handlerが無いか遅いことが、キャンセル時に一部のjobが孤立したリソースを残す理由です。
関連ガイド
What Is Signal Disposition?Signal disposition is how a process is set to respond to a given signal: run a handler, ignore it, or take th…
What Is SIGCHLD?SIGCHLD is the signal the kernel sends a parent process when one of its child processes stops or terminates,…
What Is a Graceful Shutdown Window?A graceful shutdown window is the time a process is given after a polite stop signal to finish work and clean…