ソケットリードタイムアウトとは?
ソケットリードタイムアウトとは、ソケット上の read 操作が、エラーを返すまでに受信データを待ってブロックする時間の上限です。これがないと、送信を止めた peer が read 側を永遠に待たせてしまいます。これがあれば、プログラムは速やかに失敗し、ハングする代わりに retry したり停滞を報告したりできます。
なぜ重要か
read timeout がないことは、CI の job がすぐに失敗せず、pipeline 全体のタイムアウトまでハングする頻繁な原因です。適切なタイムアウトを設定すれば、無期限のハングを、きれいで retry 可能なエラーへと変えられます。
関連ガイド
What Is TCP Keep-Alive?TCP keep-alive periodically probes an idle connection to confirm the other side is still reachable, so dead c…
What Is Blocking IO?Blocking IO pauses the calling thread until an input or output operation finishes, so the thread cannot do ot…
What Is Connection Pool Exhaustion?Connection pool exhaustion happens when all reusable connections in a pool are in use, so new requests must w…