Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deadlock due to "send before receive" #134

Closed
jakoschiko opened this issue Feb 20, 2024 · 1 comment · Fixed by #158
Closed

Deadlock due to "send before receive" #134

jakoschiko opened this issue Feb 20, 2024 · 1 comment · Fixed by #158

Comments

@jakoschiko
Copy link
Collaborator

Both ServerFlow and ClientFlow are implemented with the strategy "send before receive" (see #88 for rationale). This might result in a deadlock once the send buffers are full because neither server nor client will try to receive any bytes from the other side.

I think we can solve this by giving up the strategy "send before receive". Instead we use a select! inside the implementation of ServerFlow and ClientFlow that allows us to send and receive in parallel. However, there might be some invariants in the current implementation that expect sending to be completed before receiving is started. I expect most of them inside of send_command.rs.

This is also something we could test programmatically with flow-test.

@jakoschiko
Copy link
Collaborator Author

Might be related to #98.

@duesee duesee added this to the 9. Reworked: Higher-level, async-first, IMAP library for client- and server milestone Apr 6, 2024
@github-project-automation github-project-automation bot moved this to Done in imap-next May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants