massa icon indicating copy to clipboard operation
massa copied to clipboard

Deadlock in MockPoolController

Open gterzian opened this issue 2 years ago • 1 comments

wait_command does a blocking recv_timeout on a std::sync::mpsc::Receiver, which blocks the current thread.

In a single threaded async context(the default for the tokio tests), this means it blocks the thread running the tokio tasks, until the timeout is hit.

The quick fix can be seen in one of the last commits of https://github.com/massalabs/massa/pull/2946

The solution would be to rewrite it with an async channel(where the recv would yield the current task, allowing the other task to actually send the command).

gterzian avatar Sep 01 '22 08:09 gterzian

cc @massalabs/core-team

gterzian avatar Sep 01 '22 08:09 gterzian

This doesn't exist anymore in newer version. Close it.

AurelienFT avatar May 29 '23 07:05 AurelienFT