Skip to content

Fix #436: Resolve race condition in EmitAsync#437

Open
Zealdown wants to merge 1 commit into
doghappy:masterfrom
Zealdown:fix-436-emitasync-race-condition
Open

Fix #436: Resolve race condition in EmitAsync#437
Zealdown wants to merge 1 commit into
doghappy:masterfrom
Zealdown:fix-436-emitasync-race-condition

Conversation

@Zealdown

Copy link
Copy Markdown

Summary

Fixes a race condition in EmitAsync when multiple concurrent calls are made.

Root Cause

The packet ID generation and ACK callback registration were not synchronized, which could result in duplicate packet IDs and orphaned ACK handlers under concurrent access.

Changes

  • Added synchronization for packet ID generation
  • Protected ACK callback registration
  • Ensured thread-safe concurrent EmitAsync calls

Fixes #436

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.

Race condition in EmitAsync causes duplicate packet IDs and orphaned ACK handlers

2 participants