Watch
0
0
Fork
You've already forked hyperhive
0

hive-c0re: bound the forge readiness probe

wait_until_ready only checked READY_TIMEOUT between polls, so a half-open forge
hung the first get_version forever. The probe now goes through forge::bounded; a
timeout counts as not-ready and falls into the existing retry/deadline path.
This commit is contained in:
atlas 2026-10-09 15:55:27 +02:00 • committed by mara
commit 1726ad3bad

View file

@ -197,8 +197,8 @@ pub(crate) fn api(token: &str) -> Result<Forgejo> {
} }
/// Upper bound on one Forgejo API request. `forgejo-api` takes no /// Upper bound on one Forgejo API request. `forgejo-api` takes no
/// caller-built client, so the request itself has no timeout; every call /// caller-built client, so the request itself has no timeout; every request
/// through [`api`] is wrapped in [`bounded`]. /// in this module is wrapped in [`bounded`].
const API_TIMEOUT: Duration = Duration::from_secs(10); const API_TIMEOUT: Duration = Duration::from_secs(10);
/// Await one Forgejo API request for at most [`API_TIMEOUT`]. /// Await one Forgejo API request for at most [`API_TIMEOUT`].
@ -359,7 +359,10 @@ async fn wait_until_ready() -> bool {
let deadline = Instant::now() + READY_TIMEOUT; let deadline = Instant::now() + READY_TIMEOUT;
let mut waited = false; let mut waited = false;
loop { loop {
if client.get_version().await.is_ok() { if bounded("forge readiness probe", client.get_version())
.await
.is_ok_and(|probe| probe.is_ok())
{
if waited { if waited {
tracing::info!("forge: endpoint ready, proceeding with provisioning"); tracing::info!("forge: endpoint ready, proceeding with provisioning");
} }