Skip to content

Multi-host booking fails with 503 "calendar availability could not be checked" when hosts' calendars are slow #178

Closed

Description

@MohammadHadi2031

Before submitting

  • I've searched existing issues and this isn't a duplicate.
  • This is a reproducible bug in Calnode — not a configuration/setup question or a feature request.

What's the bug?

calendarFreeHosts (internal/handler/booking_calendar_check.go) re-checks each host's external free/busy one after another, all under a single 15s deadline. Inside one host, calendar.Service.FreeBusy also queries Google, Microsoft and CalDAV in sequence. With a collective of a few hosts on Microsoft Graph (several seconds each with a token refresh), the deadline runs out and POST /v1/bookings returns 503 "calendar availability could not be checked; please try again shortly", even though every host is free. If the deadline expires during the DB read instead, the booker gets 500 "could not complete the booking".

Separately, any single provider error fails the whole booking. That includes optional hosts, and round-robin candidates when other verified-free candidates exist. One member's revoked token blocks every booking for the team.

Steps to reproduce

  1. Collective event type with 3 required hosts, each with a connected calendar whose free/busy takes about 6s (e.g. Graph with a cold token).
  2. POST /v1/bookings for a free slot → 503 after about 15s.

Calnode version / commit

v0.11.2 (main @ 51318d3)

How are you running Calnode?

Self-hosted — Docker

Logs, screenshots, or anything else

No response

Activity

  1. pullfrog commented on Oct 28, 2026

    @pullfrog
    Contributor
  2. shockalotti commented on Oct 29, 2026

    @shockalotti
    Contributor

    All six of these are fixed and merged. Thanks — this batch was unusually well diagnosed, with file, function and mechanism in every report, which cut the work down to verifying rather than investigating.

    Landed:

    Each was verified against the old code first: your failing case reproduced, then passed. Tests came with the fixes, so they stay fixed.

    One note on #178: fail-closed is kept where attendance is mandatory. A required host we cannot read still fails the booking, because booking a seat without checking risks a double-booking. Only round-robin candidates and optional hosts are dropped. That is a deliberate line, not an oversight, in case you disagree with where it sits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions