dice icon indicating copy to clipboard operation
dice copied to clipboard

Issue 95: Unhandled "Port Address already in use"

Open ameyajoshi35 opened this issue 3 years ago • 1 comments

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 avatar Nov 11 '22 08:11 ameyajoshi35

@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?

arpitbbhayani avatar Nov 11 '22 16:11 arpitbbhayani

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.

arpitbbhayani avatar Jul 10 '24 20:07 arpitbbhayani