gear
gear copied to clipboard
Handle timeout of the wait locks
based on #1457
Maybe I've also missed some corner cases and usage issues, to be continued after remarks fixed.
This approach doesn't fix the most important parts of initial issue:
- If timeout of waiting reply reached, future should be marked ready and error returned.
- Imagine the situation:
- While processing message A, we send message B and
wait_for(100)for reply. - In 90 blocks some other message and contract's logic branch lead to
exec::wake(A) - We start processing A and run into pending future - we go into other branch of
message_loopand callwait_for(100)again! - If nothing happens further, we have waited 190 blocks instead of exactly 100 (I'd suggest to store block number of first polling also, to properly calculate waiting bound of
wait_forandwait_no_more)
Originally posted by @breathx in https://github.com/gear-tech/gear/pull/1457#pullrequestreview-1102442896