You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(pubsub): add thread safety to PubSub handler access in BaseClient
- Add volatile modifier to _pubSubHandler field for memory barrier guarantees
- Add _pubSubLock object for coordinating thread-safe access
- Implement lock-based handler access in HandlePubSubMessage() to prevent race conditions
- Update InitializePubSubHandler() with thread-safe initialization
- Enhance CleanupPubSubResources() with proper synchronization and timeout-based cleanup
- Add thread-safe access to PubSubQueue property
Add comprehensive thread safety tests:
- Test concurrent message processing from 100+ threads
- Test disposal during active message processing
- Add stress test with 100 iterations of concurrent operations
- Test concurrent access to PubSubQueue and HasPubSubSubscriptions properties
- Test rapid create/dispose cycles for memory leak detection
- Test disposal timeout handling
All 1,771 tests pass (250 unit + 1,521 integration tests).
Addresses requirements 2.1-2.6 from pubsub-critical-fixes spec.
Signed-off-by: Joe Brinkman <joe.brinkman@improving.com>
0 commit comments