Skip to content

fix(events): close event streams once the server timed out - #309

Merged
BenPinet merged 3 commits into
nextfrom
fix/close_events_on_timeout
Nov 27, 2026
Merged

BenPinet merged 3 commits into
nextfrom
fix/close_events_on_timeout

Conversation

@BotellaA

Copy link
Copy Markdown
Member

Why

Cloud sessions kept running for ~60 min after their Cloud Run service was deleted. The /events stream sends a keep-alive every 15 s, so the request never ends and Cloud Run keeps the instance alive until the request timeout (3600 s). Sessions that should last a few minutes stayed up for an hour.

What

On each keep-alive tick, the stream checks kill_task; once the server has timed out (the same condition that makes /health return 500 and triggers the service deletion), the stream ends.

Tests

  • New test_stream_closes_once_server_timed_out (fails before, passes after).
  • test_create_horizon_stack* fail locally with or without this change (OpenGeode version mismatch in my env).

Companion safety net: Geode-solutions/OpenGeodeWeb-Router#20 stops the instance after deleting the service.

🤖 Generated with Claude Code

An open /events stream, kept alive every 15 s, held the cloud instance
alive until the request timeout, long after the server stopped
answering its health check and its service was deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BenPinet
BenPinet merged commit 5530bd4 into next Nov 27, 2026
30 checks passed
@BenPinet
BenPinet deleted the fix/close_events_on_timeout branch November 27, 2026 08:55
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.

3 participants