gear icon indicating copy to clipboard operation
gear copied to clipboard

Handle timeout of the wait locks

Open clearloop opened this issue 3 years ago • 0 comments

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:

  1. If timeout of waiting reply reached, future should be marked ready and error returned.
  2. 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_loop and call wait_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_for and wait_no_more)

Originally posted by @breathx in https://github.com/gear-tech/gear/pull/1457#pullrequestreview-1102442896

clearloop avatar Sep 14 '22 07:09 clearloop