Closed diegomrsantos closed 1 month ago
Fix for:
crash on Nimbus 24.4.0 in production 9:03 EDT. 09:03:24.578950-04:00 localhost nimbus-beacon[4803]: Error: unhandled exception: Asynchronous task [sendMsgSlow() at pubsubpeer.nim:301] was cancelled! [FutureDefect]
Using await on a shared Future can raise an unexpected CancelledError if this Future gets canceled indirectly by another task. race (and join in newer versions of chronos) creates a separate future that "insulates" the shared future from the cancellation flow. See https://github.com/status-im/nim-chronos/commit/8166d7d0f16119ad74184dd3ccc001f3035537b7#diff-a6bc56e6ac55acab484b1a94671287d6f72bc6311b3ea43482b438b517ec9390R172.
await
Future
CancelledError
race
join
Fix for:
crash on Nimbus 24.4.0 in production 9:03 EDT. 09:03:24.578950-04:00 localhost nimbus-beacon[4803]: Error: unhandled exception: Asynchronous task [sendMsgSlow() at pubsubpeer.nim:301] was cancelled! [FutureDefect]
Using
await
on a sharedFuture
can raise an unexpectedCancelledError
if thisFuture
gets canceled indirectly by another task.race
(andjoin
in newer versions of chronos) creates a separate future that "insulates" the shared future from the cancellation flow. See https://github.com/status-im/nim-chronos/commit/8166d7d0f16119ad74184dd3ccc001f3035537b7#diff-a6bc56e6ac55acab484b1a94671287d6f72bc6311b3ea43482b438b517ec9390R172.