Skip to content

[vsock] cleanup half-closed connections#1101

Open
papertigers wants to merge 2 commits intospr/papertigers/master.vsock-cleanup-half-closed-connectionsfrom
spr/papertigers/vsock-cleanup-half-closed-connections
Open

[vsock] cleanup half-closed connections#1101
papertigers wants to merge 2 commits intospr/papertigers/master.vsock-cleanup-half-closed-connectionsfrom
spr/papertigers/vsock-cleanup-half-closed-connections

Conversation

@papertigers
Copy link
Copy Markdown
Contributor

@papertigers papertigers commented Apr 2, 2026

There are two scenarios under which connections are considering "closing" and we need to make sure that we handle them.

Scenario 1: The host sends a SHUTDOWN packet with VsockPacketFlags::VIRTIO_VSOCK_SHUTDOWN_F_SEND | VsockPacketFlags::VIRTIO_VSOCK_SHUTDOWN_F_RECEIVE, under normal circumstances the guest is supposed to ack this with an eventual RST packet. If we don't see the SHUTDOWN in a timely manor we send our own RST and cleanup the connection.

Scenario 2: The guest sends us a SHUTDOWN with VsockPacketFlags::VIRTIO_VSOCK_SHUTDOWN_F_SEND | VsockPacketFlags::VIRTIO_VSOCK_SHUTDOWN_F_RECEIVE, however the internal ring buffer that is flushing to the underlying socket has not yet finished draining all data. After a reasonable amount of time we need to send a RST to ack the SHUTDOWN and we need to cleanup the tracked connection state.

Created using jj-spr 0.1.0
@papertigers papertigers requested a review from iximeow April 2, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant