Skip to content

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

@coderabbitai

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done 🚀

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions