OXYGENHUB

Flow: a claimed job keeps no waiting reason 7829b7c7bb59

The reason a queued job waited stayed on it once a runner claimed it, so
the API showed a running job as 'no runner can take it'. The claim now
clears it.

closes #135
Author
Andy McCall @andymccall <[email protected]>
When
· 2026-10-11 23:27 UTC
Signature
✔ signed by Andy McCall
Hash
7829b7c7bb59af96323959718722bbba411100c09f667e3bc3ce85110d822c18
Depends on
42fa95540468 92a797b20912
Depended on by
5d90e0e045e2
In bookmarks
api-unknown-fields cancel-landed-runs clear-waiting close-proposal-140 diffusion-pin-bookmark draft-ready image-check main oh-comment-body-file proposal-list-fast
In tags
v0.5.0 v0.5.1 v0.5.2 v0.6.0 v0.6.1 v0.7.0 v0.8.0 v0.9.0 v0.9.1 v0.9.11 v0.9.15 v0.9.16 v0.9.19 v0.9.2 v0.9.20 v0.9.21 v0.9.22 v0.9.23 v0.9.24 v0.9.3 v0.9.4 v0.9.5 v0.9.6 v0.9.7 v0.9.8 v0.9.9
Edits
3 atoms, 0 tree operations, 2 files

Browse the tree at this change

modified crates/hub/src/db/flow.rs +1 −1
…
436 unchanged lines
437 437
        }
438 438
        let now = now_ms();
439 439
        let done = sqlx::query(
440 -
            "UPDATE flow_jobs SET status = 'running', runner = ?, token_hash = ?, started_ms = ? WHERE id = ? AND status = 'queued'",
440 +
            "UPDATE flow_jobs SET status = 'running', runner = ?, token_hash = ?, started_ms = ?, waiting = '' WHERE id = ? AND status = 'queued'",
441 441
        )
442 442
        .bind(runner)
443 443
        .bind(token_hash)
…
442 unchanged lines
modified crates/hub/tests/flow.rs +3 −0
…
2656 unchanged lines
2657 2657
    assert!(body.contains("does not hold image"), "{body}");
2658 2658
    let (st, body) = call(&h.app, "POST", "/api/v1/flow/claim", Some("runner-secret"), Some(ask(true))).await;
2659 2659
    assert_eq!(st, StatusCode::OK, "it fetches, and the hub holds the image: {body}");
2660 +
    // oxygenhub#135: once claimed, the old waiting reason is gone.
2661 +
    let (_, body) = call(&h.app, "GET", "/api/v1/repos/andy/demo/flow/runs/1", Some("site"), None).await;
2662 +
    assert!(!body.contains("waiting"), "a running job keeps no waiting reason: {body}");
2660 2663
}