MonitorFdHup: shorten loop delay

Apparently this is sometimes a problem for tests containing race
conditions, since it caused the daemon processes to stick around for a
second. Doesn't make writing such tests any less racey and foolish, but
we can stop doing the silly thing regardless.

CC: https://github.com/NixOS/nix/pull/12714#discussion_r2009265904
Change-Id: Iad6e55cf78c4a4517082194fa00a30d921224457
This commit is contained in:
Jade Lovelace
2025-03-23 19:00:23 -07:00
parent cad275307e
commit 12bf0b6be6
+7 -1
View File
@@ -83,7 +83,13 @@ public:
// 14.5) that in some limited cases on buggy kernel versions,
// all the non-POLLHUP events for the socket get delivered.
// Sleeping avoids pointlessly spinning a thread on those.
sleep(1);
//
// N.B. excessive delay on this can cause the daemon connection
// thread to live longer than the client and lead to
// synchronization problems if clients assume that the server
// thread has released its temporary gc roots, etc.
// See https://github.com/NixOS/nix/pull/12714#discussion_r2009265904
usleep(1'000);
}
});
};