-
Notifications
You must be signed in to change notification settings - Fork 410
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
restarting pigpiod result in "bind to port 8888 failed (Address already in use)" #298
Comments
For more details see also janvda/balena-node-red#1 |
This issue can be resolved by using the socket option SO_REUSEADDR (see https://stackoverflow.com/questions/21967311/linux-refuse-to-open-listening-port-from-localhost). So it would be nice if you would consider setting this socket option. |
I checked the code. SO_REUSEADDR is being used. |
Please retest and provide more information if its still an issue. I tried to follow your links but found evidence the problem may have been resolved. |
You currently have:
But think it should be instead:
|
@maxnet, You are correct! Thank you for reviewing the code and finding this oversight. Meanwhile, I need to bolster the testing around the network features. |
@janvda , please retest with the patch for this issue in the 'develop' branch of this repo. |
What this fix implemented? In version 78 or 79? I just encountered it on Pi OS buster Debian 10 (fully patched as of today). Happen to be running 78. May 03 00:12:29 pi3modelb0 pigpiod[32482]: 2021-05-03 00:12:29 initInitialise: bind to port 8888 failed (Cannot assign requested address) |
Yes both 78, 79. It was implemented in earlier version but don't recall which off the top of my head. |
I have defined a docker service (in balena) that runs the pigpiod daemon.
The problem is that when I try to restart that service, I am getting the following error:
I strongly think that the operating system is not allowing immediately to rebind to the same port. So you should wait for TIME_WAIT period before a process again can bind to the same port.
The text was updated successfully, but these errors were encountered: