fix(daemon): ask the OS for enough open files, and stop spinning when it says no
A search fans out to hundreds of peers, each holding a socket. A shell hands its children a soft limit of 256 open files on macOS, which one busy search blows straight through; a one-shot command never noticed because it exited before it mattered, but a resident daemon hits it and then cannot accept peers or control connections. From a client that looks like 'cannot reach the daemon: Connection closed', intermittently, for no visible reason. The daemon now raises its own soft limit to 8192 at startup, before anything opens a socket, and says so plainly when the hard limit will not allow it. macOS rejects an unlimited hard limit for open files, so both fields are named. Both accept loops also slept zero on failure. Out of descriptors does not clear by the next instruction, so one exhausted moment became a spinning core and thousands of identical log lines — which is what the report looked like. They now back off.
This commit is contained in:
Generated
+3
-2
@@ -1465,9 +1465,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.186"
|
||||
version = "0.2.189"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
|
||||
checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
|
||||
|
||||
[[package]]
|
||||
name = "libdbus-sys"
|
||||
@@ -2556,6 +2556,7 @@ dependencies = [
|
||||
"getrandom 0.4.3",
|
||||
"igd-next",
|
||||
"keyring",
|
||||
"libc",
|
||||
"ratatui",
|
||||
"schemars",
|
||||
"serde",
|
||||
|
||||
Reference in New Issue
Block a user