ytyou / ticktock

TickTockDB is an OpenTSDB-like time series database, with much better performance.
GNU General Public License v3.0
76 stars 9 forks source link

[ERROR] [main] Failed to bind to any network interfaces, errno=98 #44

Closed jens-ylja closed 1 year ago

jens-ylja commented 1 year ago

When stopping a ticktock instance and (re-)starting it a short time later - e.g. stop, run backup, re-start - the instance cannot bind to the socket ports. Within the logs one can see e.g.

[INFO] [main] Starting TCP Server on ports 5000... ... [ERROR] [main] Failed to bind to any network interfaces, errno=98

Errno 98 means address in use.

This happens in ./core/tcp.cpp when calling bind(). I assume it's due the socket ports are in TIME_WAIT state and SO_REUSEADDR isn't given.

Current workaround is to wait until the TIME_WAIT state is gone (~60s on Linux) before re-starting the instance.

ytyou commented 1 year ago

Try starting TickTockDB with the "-r" option.

ylin30 commented 1 year ago

Please try to use /admin/stop.sh and wait for "shutdown complete" message. If the problem persists, you can use kill -9 <ticktock id> to work around it.

jens-ylja commented 1 year ago

Using the -r option did the job. Thanks a lot.