Skip to content

hooks enabled: creating a lease on exporter with beforeLease onFailure exit, exporter is set offline but does not exit. #640

@evakhoni

Description

@evakhoni

Jumpstarter v0.8.2.dev113+gb19d6327f

with an exporter with beforeLease set to fail, with onFailure exit, creating a lease does not exit the exporter until the lease is manually destroyed or fully expires. the lease is created successfully, exporter is marked as offline, does not exit, and an attempt to connect to such lease causes an Error: Connection to exporter lost

 uv run jmp create lease --duration 10m --selector hooks=enabled
NAME                                  SELECTOR       EXPIRES AT  REMAINING  CLIENT      EXPORTER
019df2c1-1499-7b9a-9994-0269cc292958  hooks=enabled                         crc-client       

  uv run jmp admin get exporter --namespace jumpstarter-lab  
NAME          STATUS   ENDPOINT                               DEVICES  AGE  
crc-exporter  Unknown  grpc.jumpstarter.apps-crc.testing:443  0        7d16h
hooks-verify  Offline  grpc.jumpstarter.apps-crc.testing:443  3        6d23h

 uv run jmp get leases
NAME                                  SELECTOR       EXPIRES AT           REMAINING  CLIENT      EXPORTER    
019df2c1-1499-7b9a-9994-0269cc292958  hooks=enabled  2026-05-04 14:40:33  9m         crc-client  hooks-verify

 uv run jmp shell --lease 019df2c1-1499-7b9a-9994-0269cc292958
[05/04/26 14:31:48] INFO     [jumpstarter.client.lease] Waiting for ready connection at /run/user/1000/jumpstarter-kjz_j_dd/socket                                
                    WARNING  Connection to exporter lost: exporter is offline                                                                                     
                    WARNING  Connection to exporter lost: exporter is offline                                                                                     
Error: Connection to exporter lost

in exporter log:

INFO:jumpstarter.exporter.exporter:Starting new lease: 019df2c1-1499-7b9a-9994-0269cc292958
INFO:jumpstarter.exporter.exporter:Currently leased by crc-client under 019df2c1-1499-7b9a-9994-0269cc292958
INFO:jumpstarter.exporter.exporter:Listening for incoming connection requests on lease 019df2c1-1499-7b9a-9994-0269cc292958
INFO:jumpstarter.exporter.exporter:Creating new session for lease
INFO:jumpstarter.exporter.session:Session server started on 2 ports
INFO:jumpstarter.exporter.exporter:Session serving on main=/run/user/1000/jumpstarter-57kpkqmr/socket, hook=/run/user/1000/jumpstarter-ybp13isv/socket
INFO:jumpstarter.exporter.exporter:Accepting connections (driver calls gated until beforeLease hook completes)
INFO:jumpstarter.exporter.exporter:Updated status to BEFORE_LEASE_HOOK: Running beforeLease hook
INFO:jumpstarter.exporter.hooks:Executing before-lease hook for lease 019df2c1-1499-7b9a-9994-0269cc292958
INFO:jumpstarter.exporter.hooks:Using dedicated hook socket: /run/user/1000/jumpstarter-ybp13isv/socket (main socket: /run/user/1000/jumpstarter-57kpkqmr/socket)
INFO:jumpstarter.exporter.hooks:exit failure prelease
ERROR:jumpstarter.exporter.hooks:Hook failed with exit code 127 (on_failure=exit, raising exception)
ERROR:jumpstarter.exporter.hooks:beforeLease hook failed with on_failure='exit': Hook failed with exit code 127
INFO:jumpstarter.exporter.exporter:Updated status to BEFORE_LEASE_HOOK_FAILED: beforeLease hook failed (on_failure=exit, shutting down): Hook failed with exit code 127
INFO:jumpstarter.exporter.exporter:Updated status to OFFLINE: Exporter shutting down due to beforeLease hook failure
INFO:jumpstarter.exporter.exporter:Exporter marked for stop upon lease exit
# <-- stuck here waiting for the lease to end, does not exit, does not mark the lease as expired.

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