Skip to content

Fixes a race where await room.sid could hang even after the room SID was available in room._info.sid.#713

Open
xianshijing-lk wants to merge 1 commit into
mainfrom
sxian/fix_race_condition_about_room.sid
Open

Fixes a race where await room.sid could hang even after the room SID was available in room._info.sid.#713
xianshijing-lk wants to merge 1 commit into
mainfrom
sxian/fix_race_condition_about_room.sid

Conversation

@xianshijing-lk

Copy link
Copy Markdown
Contributor

The Python binding previously resolved _first_sid_future only from room_sid_changed. Under some event ordering, the SID could arrive through the initial connect result or room_updated first, leaving existing room.sid waiters
unresolved.

Changes

  • Shield _first_sid_future so caller-side asyncio.wait_for(room.sid, ...) timeouts do not cancel shared Room state.
  • Add _resolve_first_sid() helper.
  • Resolve the first SID future from:
    • initial connect result
    • room_sid_changed
    • room_updated
    • moved

Testing

Run Theo's sid_repro.py

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

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