Commit b87e91e
remote-bench: detach bench in tmux so SSH disconnects can't kill it
Long aggregations exceed the IAP tunnel idle timeout (~30 min in
practice). When the tunnel resets, gcloud's `compute ssh --command`
session dies, the bench process gets SIGHUP'd, and we lose the run.
Hit this today running c4-standard-{8,16,32}: VMs went idle ~30 min
in, no result files written.
Fix: split the remote work across two SSH calls.
1. Synchronous setup (existing ssh_exec): apt + rustup + uv + clone +
prereqs. Short, well-bounded; live output streams to local stdout.
2. The actual bench is launched into a detached `tmux` session
(`tmux new-session -d -s leanbench ./run-bench.sh`) so it's owned
by tmux, not by the SSH session. The setup ssh_exec returns
immediately after launching it.
The orchestrator then enters _poll_bench_completion, which every
--poll-interval-s seconds (default 30):
- tail -c +N leanBench/bench.log (stream new output to local stdout)
- tmux has-session -t leanbench (check if bench has finished)
- on completion, read leanBench/bench.exit for the exit code
Tolerates transient SSH failures (up to 6 in a row) so a brief IAP
hiccup doesn't trigger the outer try/except → finally → destroy
cascade and abort a healthy bench. On final-give-up, prints the
gcloud command to manually `tmux attach -t leanbench` and recover.
remote_setup.sh apt-installs `tmux`, writes a small run-bench.sh that
captures the bench exit code to bench.exit, and launches it via tmux.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8f546fd commit b87e91e
2 files changed
Lines changed: 92 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
| |||
272 | 278 | | |
273 | 279 | | |
274 | 280 | | |
275 | | - | |
276 | | - | |
277 | | - | |
| 281 | + | |
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
| |||
285 | 289 | | |
286 | 290 | | |
287 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
288 | 303 | | |
289 | 304 | | |
290 | | - | |
291 | | - | |
292 | 305 | | |
293 | 306 | | |
294 | 307 | | |
| |||
331 | 344 | | |
332 | 345 | | |
333 | 346 | | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
334 | 407 | | |
335 | 408 | | |
336 | 409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
55 | 59 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
0 commit comments