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 authored and Cuong Manh Le committed 2023-03-31 10:18:14 +07:00
1 parent b3a342bc44
commit ba48ff5965
4 files changed
+39 -3

No files matched your search

+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())