restarting an exporter from underneath a client with both hooks, the client errors and kills the lease prematurely
uv run jmp shell --selector hooks=both --duration 30m
[02/17/26 18:42:53] INFO Acquiring lease 019c6c7b-b7dc-7aa6-8f75-ed2c72316f42 for selector hooks=both for duration 0:30:00 [jumpstarter.client.lease]
INFO Waiting for ready connection at /run/user/1000/jumpstarter-wy3f_6xu/socket [jumpstarter.client.lease]
[02/17/26 18:43:04] INFO Status changed: None -> LEASE_READY (version=3) [jumpstarter.client.status_monitor]
INFO Starting hook subprocess... [exporter:beforeLease]
INFO Creating PTY pair... [exporter:beforeLease]
python ⚡hooks-test-both ➤ INFO PTY created: parent_fd=18, child_fd=19 [exporter:beforeLease]
INFO Executing inline script (interpreter: /bin/sh) [exporter:beforeLease]
INFO Spawning subprocess with command: ['/bin/sh', '-c', 'echo "Powering on..."\nj power on\nsleep 5\necho "ok"\nsleep 5\necho "done prelease"\n']
[exporter:beforeLease]
INFO Subprocess spawned with PID 2689707 [exporter:beforeLease]
INFO Starting PTY output reader and process waiter (timeout=60) [exporter:beforeLease]
INFO Task group created, starting tasks... [exporter:beforeLease]
INFO Waiting for subprocess to complete... [exporter:beforeLease]
INFO Powering on... [exporter:beforeLease]
INFO ok [exporter:beforeLease]
INFO done prelease [exporter:beforeLease]
INFO Subprocess completed with code: 0 [exporter:beforeLease]
INFO Hook executed successfully [exporter:beforeLease]
# < at this point we briefly restart the exporter in the background
python ⚡hooks-test-both ➤ [02/17/26 18:43:14] INFO Connection lost (UNAVAILABLE), signaling waiters [jumpstarter.client.status_monitor]
[02/17/26 18:43:23] INFO Lease 019c6c7b-b7dc-7aa6-8f75-ed2c72316f42 ended at 2026-02-17 18:43:16+02:00 [jumpstarter.client.lease]
INFO Running afterLease hook (Ctrl+C to skip)... [jumpstarter_cli.shell]
Error: Ready for commands
✘
restarting an exporter from underneath a client with both hooks, the client errors and kills the lease prematurely