Skip to content

Fix: Calling close() twice hangs multi-isolate servers #293

Closed

Description

@coderabbitai

Problem

Calling close() twice on a multi-isolate Relic server causes the application to hang. This was discovered during testing of graceful shutdown behavior.

Current Behavior

When server.close() is called twice on a multi-isolate server configuration, the second call causes the server to hang indefinitely instead of returning immediately or throwing an appropriate error.

Expected Behavior

  • The second call to close() should either:
    • Return immediately (idempotent behavior)
    • Throw a clear error indicating the server is already closed
    • Complete without hanging

Context

This issue was identified in PR #292 during graceful shutdown testing. A workaround was implemented using a serverClosed flag in tests to prevent calling close() twice in tearDown.

Related

Activity

  1. nielsenko commented on Dec 1, 2025

    @nielsenko
    Collaborator

    Close should be idempotent.

  2. moved this from Inbox 📫 to Done 🚀 in Serverpod Frameworkson Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions