feat(scripts): all-in-one host-house.sh; free stale port; fail-fast join sync
CI / rust client (hh) (macos-latest) (push) Waiting to run
CI / rust client (hh) (ubuntu-latest) (push) Waiting to run
CI / rust coverage (push) Waiting to run
CI / python server (3.10) (push) Waiting to run
CI / python server (3.11) (push) Waiting to run
CI / python server (3.12) (push) Waiting to run
CI / headless e2e smoke (push) Waiting to run
CI / dependency audit (push) Waiting to run
CI / secret scanning (push) Waiting to run
CI / rust client (hh) (macos-latest) (push) Waiting to run
CI / rust client (hh) (ubuntu-latest) (push) Waiting to run
CI / rust coverage (push) Waiting to run
CI / python server (3.10) (push) Waiting to run
CI / python server (3.11) (push) Waiting to run
CI / python server (3.12) (push) Waiting to run
CI / headless e2e smoke (push) Waiting to run
CI / dependency audit (push) Waiting to run
CI / secret scanning (push) Waiting to run
- host-house.sh: one tmux session hosting a room (server window) plus your own GUI client window — builds, frees the port, waits for /health, then attaches. - host-room.sh: free_port() kills any stale LISTENer squatting on the port so the bind can't fail with "address already in use". - join.sh: cap each remote pull with `timeout` + GIT_TERMINAL_PROMPT=0 so an unreachable remote fails fast instead of hanging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -103,6 +103,22 @@ else
|
||||
PROTO="http"; CLIENT_FLAG="--no-tls"
|
||||
fi
|
||||
|
||||
# Free the port if a stale listener is squatting on it (e.g. a server left over
|
||||
# from a previous run), so the bind can't fail with "address already in use".
|
||||
# We only target processes LISTENing on this TCP port, then escalate to -9.
|
||||
free_port() {
|
||||
local port="$1" pids
|
||||
pids="$(lsof -ti "tcp:$port" -sTCP:LISTEN 2>/dev/null || true)"
|
||||
[[ -z "$pids" ]] && pids="$(fuser "$port/tcp" 2>/dev/null | tr -s ' ' '\n' | grep -E '^[0-9]+$' || true)"
|
||||
[[ -z "$pids" ]] && return 0
|
||||
echo "⚠ port $port already in use by PID(s): $(echo "$pids" | tr '\n' ' ')— killing" >&2
|
||||
kill $pids 2>/dev/null || true
|
||||
sleep 0.5
|
||||
pids="$(lsof -ti "tcp:$port" -sTCP:LISTEN 2>/dev/null || true)"
|
||||
[[ -n "$pids" ]] && { echo " still alive — SIGKILL" >&2; kill -9 $pids 2>/dev/null || true; }
|
||||
}
|
||||
free_port "$PORT"
|
||||
|
||||
# Sanity-check deps so failures are an actionable hint, not a stack trace.
|
||||
if ! "$PY" -c "import sanic" >/dev/null 2>&1; then
|
||||
echo "✖ Python deps missing (sanic not importable with $PY)." >&2
|
||||
|
||||
Reference in New Issue
Block a user