madsim-rs / madsim

Magical Deterministic Simulator for distributed systems in Rust.
Apache License 2.0
622 stars 41 forks source link

fix: break cascade drop to prevent deadlock on kill #125

Closed wangrunji0408 closed 1 year ago

wangrunji0408 commented 1 year ago

When killing a node, it may cause a cascade drop for the tasks of this node, where there will be a reentrancy of a lock in the call stack. This way, the program will fall into a deadlock. This PR fixes it by introducing a temporary store for runnable when being wakened up on kill so that the cascade drop can be broken.