Skip to content

waiting_room: fail_open when the waiting page can't be reached - #5

Merged
deflinhec merged 1 commit into
mainfrom
claude/project-thread-gm87nb
Nov 30, 2026
Merged

deflinhec merged 1 commit into
mainfrom
claude/project-thread-gm87nb

Conversation

@deflinhec

Copy link
Copy Markdown
Member

Requested by Danny · project thread

Why

On 2026-11-30 (11:45–12:40 UTC) connections from Cloudflare's European locations to the origin failed intermittently. Sites send every visitor without a pass to the hosted waiting page, so visitors who could not load that page could not reach the protected page either. The waiting room guards fail closed today. Same option as hibira-io/waiting-room#12.

What

  • WaitingRoom(fail_open=True, fail_open_timeout=1.5, on_fail_open=...), off by default.
  • Before redirecting or denying a visitor without a pass, decide() calls WaitingRoom.reachable(): GET <host>/waitroom/<key>/<room> with urllib (no new dependency). A timeout, network error or 5xx returns Decision('allow', fail_open=True).
  • One answer per room, kept 15 s (thread-safe module cache).
  • ASGI: the decision runs in asyncio.to_thread when fail_open is on, so the probe never blocks the event loop. request.state.hibira_fail_open / environ['hibira.fail_open'].
  • README (+ 中文), CHANGELOG.

Tests

pytest: 68 passed, 1 skipped (3 new: down/up/error/off and ASGI). ruff check, ruff format --check, mypy src clean.


Generated by Claude Code

…an't be reached

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SHtsCFgmLu9NFyRNqE5txQ
@deflinhec deflinhec self-assigned this Nov 30, 2026
@deflinhec
deflinhec marked this pull request as ready for review November 30, 2026 16:45
@deflinhec
deflinhec merged commit dcd9792 into main Nov 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants