After wiring Mysticeti to SUI it looks like it wasn't able to properly shutdown giving us errors when trying to bootstrap again the validator node like:
Failed to bind to local socket: Os { code: 48, kind: AddrInUse, message: "Address already in use" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
which basically raised suspicions of networking not properly shutting down and potentially a few other components too.
By using a simple test that starts and shutdown a validator not and using tokio-console we could see that some tasks were not terminating (amongst them network as well occupying the current port)
after introducing explicit handling on propagating shutdown signals to the task components after shutting down the validator we can see that none of the tasks is running any more:
a test has been introduced for this case which is successfully passing after the introduced changes. Running the same test in main fails with a Failed to bind to local socket: Os { code: 48, kind: AddrInUse, message: "Address already in use" } error.
After wiring Mysticeti to SUI it looks like it wasn't able to properly shutdown giving us errors when trying to bootstrap again the validator node like:
which basically raised suspicions of networking not properly shutting down and potentially a few other components too.
By using a simple test that starts and shutdown a validator not and using tokio-console we could see that some tasks were not terminating (amongst them network as well occupying the current port)
after introducing explicit handling on propagating shutdown signals to the task components after shutting down the validator we can see that none of the tasks is running any more:
a test has been introduced for this case which is successfully passing after the introduced changes. Running the same test in main fails with a
Failed to bind to local socket: Os { code: 48, kind: AddrInUse, message: "Address already in use" }
error.