|
Fix thread-unsafe sequence counter causing heapq comparison crash
The _send_seq += 1 approach had a race condition: two threads calling send() simultaneously could load the same counter value, producing two queue items with identical (priority, seq) tuples. heapq then compares the third element (protobuf message), which crashes with TypeError. Replace with itertools.count() whose next() is GIL-atomic in CPython â each call is a single C-level operation that cannot be interrupted mid- increment. Also fix the legacy fallback path in LiveNodeRecord.send_message and remove the duplicate 'import queue' in node_registry.py. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
|---|
|
|
| ai-hub/app/core/services/node_registry.py |
|---|
| mesh-sdk/mesh_core/transport/grpc.py |
|---|