-
Notifications
You must be signed in to change notification settings - Fork 112
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 hints to port conflict and lock file panics #1535
Conversation
It might also be helpful to add an acceptance test that:
I added a random_port() function to the acceptance tests a few days ago - you can use it to pick a random port for this test's config. |
I can't see how to reproduce #1509. For #1484 i can just open the port with some other program, for #1508 i can run 2 instances of zebrad in different ports. For #1509 according to logs the error should be originated here https://github.com/ZcashFoundation/zebra/blob/main/zebrad/src/components/sync.rs#L280 |
See this comment in #1484:
Try disabling the metrics and tracing listeners, and just having a Zcash network protocol listener? There are 3 different ports that can conflict:
We need to cover all 3 cases in this PR. |
If you have a zcashd running what you get with this PR is:
|
I actually don't see #1484 referring to metrics or tracing endpoints. By the description it seems clear to me that the problem is at port 8233 which is the network port. |
Yes, but any of those ports can conflict, so we need to add hints to all of them. |
Makes sense, i will take care of this. |
Added hints for tracing and metric endpoints port conflict in abfe4f6 and 73a74ef. When i saw the tracing one i noticed there was a hint as an error and i changed to a panic. I understand the application could continue without the tracing endpoint but it is not what the user will want. I think a panic is fine here but not totally sure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks great ^_^
Avoids weird escaping on Windows when using Debug
And add another Windows-specific port error alternative
And silence a clippy warning
Last changes looks good, thanks @teor2345 , looks like this one is finally ready. CI failing at large sync tests which is unrelated here, all normal tests passing. |
I updated #1651 to add the error message we saw in this CI run. Still Windows large sync tests, but at a slightly different stage of linking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're good to go here.
Motivation
The port conflict and the lock file messages are hard to understand. We want to add a hint so the user can rerun with a fixed configuration.
Solution
We add 2 panics in this PR with custom messages. We filter the issue url as we don't want users to report this as it is expected to happen if they have another instance of zebrad running in the same machine.
There are 3 different ports that can conflict, and the lock file can conflict:
We need to cover all 4 cases in this PR.
The code in this pull request has:
Review
Maybe @yaahc and/or @teor2345 . Not urgent.
Related Issues
Close #1484, close #1508, close #1632, close #1509 if merged.
Follow-Up Tasks
Make initial peers DNS resolution async #1613
Make listener DNS resolution non-blocking #1631
Interrupt handler does not work when a blocking task is running #1351
Windows state path message #1654