From 2c61389d6c52cfa5530d22b39fc998130c1bf7cf Mon Sep 17 00:00:00 2001
From: Ryan Hendrickson <ryan.hendrickson@alum.mit.edu>
Date: Sat, 14 Oct 2023 19:29:03 -0400
Subject: [PATCH] build02/nixpkgs-update: make socat more patient

This may address the intermittent ConnectionResetErrors we're seeing
from the supervisor. By default, socat will terminate its connection to
one side half a second after the other side closes; if the supervisor is
taking more than half a second to respond, this results in dropped jobs.
Bumping this timeout to five seconds should help.
---
 hosts/build02/nixpkgs-update.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hosts/build02/nixpkgs-update.nix b/hosts/build02/nixpkgs-update.nix
index b86225c..da4e95a 100644
--- a/hosts/build02/nixpkgs-update.nix
+++ b/hosts/build02/nixpkgs-update.nix
@@ -66,7 +66,7 @@ let
 
       msg=READY
       while true; do
-        response=$(echo "$msg" | socat UNIX-CONNECT:"$socket" - || true)
+        response=$(echo "$msg" | socat -t5 UNIX-CONNECT:"$socket" - || true)
         case "$response" in
           "") # connection error; retry
             sleep 5