-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a hint to the port conflict panic #1484
Comments
We need to find out if the port we are going to bind is already in use. The sooner we do it is better as this is a fatal condition. Right now, the failure we see is deeply inside zebra-network. I think we should check and exit long before, somewhere around https://github.com/ZcashFoundation/zebra/blob/main/zebrad/src/commands/start.rs#L46 Next, how to do the check. I am unsure if there is an easy way with what we currently have. One option will be to add a new dependency: https://docs.rs/port_scanner/0.1.5/port_scanner/fn.local_port_available.html Looking for advice. Thanks! |
Unfortunately, there's no reliable cross-platform way to check if a port is already in use. That's because different operating systems have different rules for port conflicts. And some OSes allow programs to open ports that never conflict. We should also avoid trying to open the port early, closing it, then opening it for real. Because that can lead to a temporary failure due to the TCP retransmit interval. So the best way to handle this error is to try to use the port in If we wanted that message to happen earlier, we could try to open the listener port early in |
Analysis
The port conflict panic message is hard to understand, we should add a hint about changing the default port.
This change should be made with #1509, because they need similar hints.
Version
v1.0.0-alpha.0
Platform
Unknown
Description
it is syncing, after changing the default listen address
if you have zcashd occupying
8233
it just panics withzebra_network::peer::connection: e=buffered service failed: buffered service failed: Address already in use (os error 98)
The text was updated successfully, but these errors were encountered: