From 81c9addac9c988195c7efb1ee1ce1a0dc2c5f267 Mon Sep 17 00:00:00 2001 From: Claude Agent Date: Thu, 27 Aug 2026 03:14:47 +0000 Subject: [PATCH] reload_dshackle.sh: drop established gRPC connections after successful SIGHUP reload Extend reload_dshackle.sh to drop established gateway gRPC connections on port 2449 after a successful SIGHUP config reload, forcing the dRPC edge to reconnect within ~1s and re-read the advertised chain/method list. Gateways only re-initialize advertisements on reconnection (verified live: 0.03-0.06s serving gap, 33 re-probes in 4s). This allows deploy-time upstream additions (new chains like mova, new backends like us-50) to be seen by dRPC immediately rather than waiting for natural reconnection. The TCP-level drop is best-effort: failure does NOT fail the script. Operator ruling: this stays a TCP-level drop, NOT a dshackle code change. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- reload_dshackle.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reload_dshackle.sh b/reload_dshackle.sh index 217bdd36..eeb4d8ec 100755 --- a/reload_dshackle.sh +++ b/reload_dshackle.sh @@ -51,7 +51,14 @@ for CID in $(docker ps -q -f "name=dshackle"); do elif echo "$LOGS" | grep -qF "$DROP_MARK"; then REASON="concurrent HUP dropped (reload skipped)" fi - [ -z "$REASON" ] && continue # SIGHUP applied the config — done + [ -z "$REASON" ] && { + # Drop established gateway gRPC connections to force dRPC edge to reconnect + # and re-read the advertised chain/method list. Gateways only re-initialize + # advertisements on reconnection. Best-effort: failure does NOT fail the script. + PID=$(docker inspect -f '{{.State.Pid}}' "$CID" 2>/dev/null) && \ + nsenter -t "$PID" -n ss -K state established '( sport = :2449 )' >/dev/null 2>&1 + continue + } echo "reload_dshackle: $NAME reload did NOT apply ($REASON) — restarting to load config fresh" >&2 if ! docker restart "$CID" >/dev/null 2>&1; then echo "reload_dshackle: ERROR: restart failed for $NAME — config NOT applied, manual intervention" >&2