Skip to content

agent: prevent deletion from waiting for space in the event queue - #2076

Closed
evgeny-simplex wants to merge 2 commits into
simplex-chat:stablefrom
evgeny-simplex:ep/del-conns-async
Closed

evgeny-simplex wants to merge 2 commits into
simplex-chat:stablefrom
evgeny-simplex:ep/del-conns-async

Conversation

@evgeny-simplex

Copy link
Copy Markdown
Contributor

deleteConnectionsAsync wrote DEL_CONNS for connections without a receive queue or without an agent record to the event queue in the calling thread, and deleteUser wrote DEL_USER for a user without connections in the same way. When the queue was full, the calling thread waited until the application read events; simplex-chat makes these calls while holding a lock that its event thread can wait for, so neither thread proceeded.

Change: both events are written with nonBlockingWriteTBQueue, as other events written in API calls: in the calling thread while the queue has space, as before, otherwise by a separate thread once the queue has space.

Tests: two tests fill the event queue, check that the deletion returns, then read the event.

event queue is full

Copy link
Copy Markdown
Contributor Author

Replaced by #2079.

@evgeny-simplex
evgeny-simplex deleted the ep/del-conns-async branch November 17, 2026 03:27
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