dice
dice copied to clipboard
Issue 95: Unhandled "Port Address already in use"
This PR has below changes.
- logs the error if 7379 port "Address already in use" and exits with status 1.
- Adds debug flag (default false) and set of debug ports. (for now 7380,7381)
- If debug mode enabled. (debug = true) and port 7379 already in use. Try starting the async tcp server on debug ports.
@ameyajoshi35 How is this solving issue of "Port Address already in use"?
Looks like it is only solving it when we are running in the debug mode? Have you seen this approach being taken by some DB/utility, if yes then can you share the link?
Hello @ameyajoshi35,
I have fixed the issue in my latest merge by using socket opt so_reuseaddr and also retrying for other ports. By so_reuseaddr, the process will forcefully bind to the same port and hence "address already in use" error won't crop up.
But thanks for raising the PR.