Skip to content

hooks: exiting a shell from a lease created with jmp create lease - invalidates the lease but keeps the exporter unleasable #239

@evakhoni

Description

@evakhoni

on exporter without hooks - exiting a shell from a lease created with jmp create lease - the lease is not closed, but exporter switches into Available state and any attempt to use the lease errors with connection lost, while the exporter is unleasable until this broken lease is deleted or expires:

 uv run jmp create lease --duration 10m --selector hooks=none
NAME                                  SELECTOR    BEGIN TIME  DURATION  CLIENT        EXPORTER
019c7098-f588-743a-b76e-cb21a0fe2d4d  hooks=none              0:10:00   hooks-client          

 uv run jmp shell --lease 019c7098-f588-743a-b76e-cb21a0fe2d4d        
[02/18/26 13:53:47] INFO     Waiting for ready connection at /run/user/1000/jumpstarter-mn2dgcsb/socket [jumpstarter.client.lease]            
[02/18/26 13:53:49] INFO     Status changed: None -> LEASE_READY (version=2) [jumpstarter.client.status_monitor]                              
python ⚡hooks-test-none ➤ exit
[02/18/26 13:53:53] INFO     Running afterLease hook (Ctrl+C to skip)... [jumpstarter_cli.shell]                                              
                    INFO     Status changed: LEASE_READY -> AVAILABLE (version=3) [jumpstarter.client.status_monitor]                         
                    INFO     afterLease hook completed [jumpstarter_cli.shell]                                              

 uv run jmp get leases
NAME                                  SELECTOR    BEGIN TIME           DURATION  CLIENT        EXPORTER       
019c7098-f588-743a-b76e-cb21a0fe2d4d  hooks=none  2026-02-18 13:53:18  0:10:00   hooks-client  hooks-test-none

 uv run jmp shell --lease 019c7098-f588-743a-b76e-cb21a0fe2d4d
[02/18/26 13:54:55] INFO     Waiting for ready connection at /run/user/1000/jumpstarter-qg0ihgrt/socket [jumpstarter.client.lease]            
Error: Connection to exporter lost

 uv run jmp admin get exporter --namespace jumpstarter-lab    
NAME             STATUS     ENDPOINT                               DEVICES  AGE  
hooks-test-both  Offline    grpc.jumpstarter.10.0.0.1.nip.io:8082  0        7d15h
hooks-test-none  Available  grpc.jumpstarter.10.0.0.1.nip.io:8082  3        7d15h

 uv run jmp shell --selector hooks=none --duration 20s        
[02/18/26 14:04:48] INFO     Acquiring lease 019c70a3-7ca3-738e-80a9-d269d138f217 for selector hooks=none for duration 0:00:20                
                             [jumpstarter.client.lease]                                                                                       
⠹ Waiting for lease: There are 1 approved exporters, (i.e. ) but all of them are already leased (0:01:39)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghooks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions