Open battlmonstr opened 11 months ago
One place where this still happens is in the sentry GRPC servers. In this case BuildAndStart returns null here: https://github.com/erigontech/silkworm/blob/master/silkworm/infra/grpc/server/server.hpp#L84
It is possible to implement GlobalCallbacks::AddPort, and call grpc::Server::SetGlobalCallbacks(...)
to register the implementation. BuildAndStart()
calls it here and that should trigger a callback. If port == 0
in the AddPort
callback, we can assume that the port is busy.
This gives information to extend the error message here: https://github.com/erigontech/silkworm/blob/master/silkworm/infra/grpc/server/server.hpp#L86
When starting silkworm without arguments after staring erigon without arguments on the same computer, silkworm crashes with "Unrecoverable failure: Address already in use" and no other clues. Apparently it wants to occupy some default TCP/UDP ports that are in use by the erigon process.
The error message needs to be improved to explain what port is occupied, what for is it needed, and which command line parameter must be passed to customize it.