[Apple] Lock over the same object in SafeDeleteSslContext to serialize access to the buffers#117982
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR addresses a synchronization issue in the OSX SafeDeleteSslContext class where different methods were using different lock objects, potentially causing race conditions when accessing shared buffer resources. The change introduces a dedicated _lock object to ensure consistent synchronization across all methods that access the _inputBuffer and _outputBuffer fields.
Key changes:
- Introduces a dedicated
_lockobject for thread synchronization - Replaces inconsistent lock targets (
_sslContextvsSafeDeleteSslContextinstance) with the new_lockobject - Ensures all buffer access operations are properly synchronized
|
Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @ivanpovazan, @steveisok, @akoeplinger |
|
/backport to release/9.0 |
|
Started backporting to |
|
/backport to release/9.0-staging |
|
Started backporting to |
Description
OSX SafeDeleteSslContext takes lock on different object in managed callbacks and other methods. In the callbacks, the lock is SafeDeleteSslContext, while in Dispose and other methods the lock is SafeSslHandle.
This PR adds a
_lockto ensure synchronization across all methods that access shared buffers. The issue was identified while working on #117950.