wenjin272 commented on issue #983: URL: https://github.com/apache/flink-agents/issues/983#issuecomment-5237527035
Thanks for catching this @weiqingy. A concrete possibility for the zero-item case is an existing context-switching race in asynchronous LTM execution. `Mem0LongTermMemory` is shared across keys, and `switch_context` mutates its `self.key`. When Key1 submits `memory_set.add` through `durable_execute_async`, the callable runs in a worker thread while the mailbox can start processing Key2 and switch the shared LTM context. The Key1 worker then reads the current `self.key` when calling Mem0, so its item may be written with `agent_id=Key2`. A subsequent read under Key1 would return zero items. We cannot prove that this caused the recorded CI failure, but the race is real and matches the symptom. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
