Repository navigation
Conversation
tmakatos
marked this pull request as draft
October 21, 2026 22:09
tmakatos
force-pushed
the
control-socket-peer-cache
branch
3 times, most recently
from
October 22, 2026 09:40
606a377 to
9760a36
Compare
tmakatos
marked this pull request as ready for review
October 22, 2026 09:41
tmakatos
force-pushed
the
control-socket-peer-cache
branch
from
October 22, 2026 10:14
9760a36 to
8fc04dd
Compare
tmakatos
force-pushed
the
control-socket-peer-cache
branch
from
October 22, 2026 10:30
8fc04dd to
197c8cc
Compare
tmakatos
force-pushed
the
control-socket-peer-cache
branch
from
October 22, 2026 10:47
197c8cc to
46b2f39
Compare
tmakatos
force-pushed
the
control-socket-peer-cache
branch
from
October 22, 2026 10:52
46b2f39 to
96b7e70
Compare
tmakatos
force-pushed
the
control-socket-peer-cache
branch
from
October 22, 2026 11:04
96b7e70 to
46b2f39
Compare
tmakatos
force-pushed
the
control-socket-peer-cache
branch
3 times, most recently
from
October 22, 2026 12:32
5402770 to
c88b7fb
Compare
tmakatos
force-pushed
the
control-socket-peer-cache
branch
from
October 22, 2026 13:20
c88b7fb to
e2895c4
Compare
tmakatos
force-pushed
the
control-socket-peer-cache
branch
from
October 22, 2026 13:40
80c49ec to
3e34d41
Compare
tmakatos
force-pushed
the
control-socket-peer-cache
branch
from
October 22, 2026 13:43
3e34d41 to
3bd8a91
Compare
tmakatos
force-pushed
the
control-socket-peer-cache
branch
2 times, most recently
from
October 22, 2026 13:59
27de12c to
e38e016
Compare
tmakatos
force-pushed
the
control-socket-peer-cache
branch
2 times, most recently
from
October 22, 2026 16:45
13f33fd to
a44899d
Compare
tmakatos
force-pushed
the
control-socket-peer-cache
branch
2 times, most recently
from
October 23, 2026 07:23
67c8197 to
758c8f5
Compare
lforchini
requested changes
Oct 26, 2026
Comment on lines
+313
to
+319
| /// Control-socket peers identified by earlier discovery passes, keyed by | ||
| /// socket path. | ||
| /// | ||
| /// Backends may listen with a minimal backlog, in which case connecting on | ||
| /// every pass just to read the peer credentials fails with `EAGAIN` whenever | ||
| /// an earlier connection has not been accepted yet. | ||
| static PEER_CACHE: LazyLock<Mutex<HashMap<PathBuf, CachedPeer>>> = LazyLock::new(Default::default); |
Collaborator
There was a problem hiding this comment.
This would make it tougher to test, could we make an Inventory struct or similar which keeps this state and have cached_control_socket_peer_pid and discover_via_control_socket on that?
Collaborator
Author
There was a problem hiding this comment.
Which aspect exactly makes it harder to test? The fact that it's static?
|
|
||
| /// Return the start time of `pid`, or `None` if it no longer exists. | ||
| fn process_start_time(pid: i32) -> Option<u64> { | ||
| procfs::process::Process::new(pid) |
Collaborator
There was a problem hiding this comment.
This should probably use new_with_root and the util::Path
Collaborator
Author
There was a problem hiding this comment.
Are you talking about how it will be after you've merged your PR?
tmakatos
force-pushed
the
control-socket-peer-cache
branch
5 times, most recently
from
October 26, 2026 16:44
17b5fe2 to
d9be6b8
Compare
tmakatos
force-pushed
the
control-socket-peer-cache
branch
from
October 26, 2026 16:45
d9be6b8 to
bab5df6
Compare
Discovery connected to every VM's control socket on every pass, only to read the peer PID, even for VMs already tracked. Backends that listen with a minimal backlog reject such a connection with EAGAIN while an earlier one is still pending, which logged a warning and dropped the VM from that discovery pass. Cache the peer PID per socket path and reconnect only when the socket file is replaced or the cached process is gone. EAGAIN on a socket that isn't cached yet is transient, so log it at debug and retry on the next pass. AI-generated: everything Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
tmakatos
force-pushed
the
control-socket-peer-cache
branch
from
October 26, 2026 17:02
bab5df6 to
ef9721c
Compare
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Discovery connected to every VM's control socket on every pass, only
to read the peer PID, even for VMs already tracked. Backends that
listen with a minimal backlog reject such a connection
with EAGAIN while an earlier one is still pending, which logged a
warning and dropped the VM from that discovery pass.
Cache the peer PID per socket path and reconnect only when the socket
file is replaced or the cached process is gone. EAGAIN on a socket that
isn't cached yet is transient, so log it at debug and retry on the next
pass.
AI-generated: everything
Signed-off-by: Thanos Makatos thanos.makatos@nutanix.com
Stack created with GitHub Stacks CLI • Give Feedback 💬