Zannick/logic-graph

Error handling for cycles detected in the statedb

开放

#185 创建于 2024年6月15日

 (0 条评论) (0 个反应) (0 位负责人)Rust (0 个派生)auto 404
help wanted

仓库指标

星标
 (4 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

This can randomly cause a crash. The one I experienced today:

Cycle of length 2 found ending at depth 0:
[[A(Global__Become_Drone)], [A(Global__Become_Indra)]]

These are actions that reverse each other, so while technically a valid sequence of actions, whichever was the last one (I suspect Become Drone based on detect_cycle) should not have resulted in a state being written. However, if it was a state that already existed, and it was found to be faster to reach by becoming drone from a state that was Indra, and that was found to be faster by becoming Indra from a state that was drone... anyway, I'm not sure if this is resolved on its own by the thread that's writing each of these improvements, or if it's a permanent effect of a race condition or order of operations weirdness. If it will resolve on its own, we could just wrap the direct caller into an error handling function that will sleep and try again a small number of times. If not... we need some other resolution such as rewriting the state (which would require figuring it out again).

贡献者指南