all: fix os resolver hangs when all server failed

For os resolver, ctrld queries against all servers concurrently, and get
the first success result back. However, if all server failed, the result
channel is not closed, causing ctrld hang.

Fixing this by closing the result channel once getting back all response
from servers.

While at it, also shorten the backoff time when waiting for network up,
ctrld should serve as fast as possible after network is available.

Updates #34
This commit is contained in:
Cuong Manh Le
2023-03-30 02:43:37 +07:00
committed by Cuong Manh Le
parent b3a342bc44
commit ba48ff5965
4 changed files with 39 additions and 3 deletions
+1 -2
View File
@@ -160,8 +160,7 @@ func initCLI() {
log.Fatalf("failed to unmarshal config: %v", err)
}
log.Println("starting ctrld ...")
log.Printf("version: %s\n", curVersion())
log.Printf("starting ctrld %s\n", curVersion())
oi := osinfo.New()
log.Printf("os: %s\n", oi.String())