-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
iwf-python-sdk/iwf/communication.py
Line 51 in a13c309
| def publish_to_internal_channel(self, channel_name: str, value: Any = None): |
Here's part of the publish_to_internal_channel func :
def publish_to_internal_channel(self, channel_name: str, value: Any = None):
...
vals = self._to_publish_internal_channel.get(channel_name)
if vals is None:
vals = []
vals.append(self._object_encoder.encode(value))
self._to_publish_internal_channel[channel_name] = valsWhen multiple threads hitting this function, it could have a race condition where
Thread A gets vals = [1,2,3]
Thread B gets vals = [1,2,3]
Thread A updates it to be [1,2,3,4]
Thread B updates it to be [1,2,3,5]
Here we lost 4 permanently
Metadata
Metadata
Assignees
Labels
No labels