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

Poll based datapaths can hang sends in race condition with kernel #2654

Closed
2 of 7 tasks
thhous-msft opened this issue Apr 22, 2022 · 0 comments · Fixed by #2655
Closed
2 of 7 tasks

Poll based datapaths can hang sends in race condition with kernel #2654

thhous-msft opened this issue Apr 22, 2022 · 0 comments · Fixed by #2655
Labels

Comments

@thhous-msft
Copy link
Contributor

Describe the bug

For sends in the datapath, we don't enable the edge triggers until after a socket write returns EAGAIN or EWOULDBLOCK. However, if sends in the kernel become enabled between calling send() and epoll_ctl (Or equivalent in other paths), the epoll event would never tirgger, and the sends would be hung forever for that socket.

Affected OS

  • All
  • Windows Server 2022
  • Windows 11
  • Windows Insider Preview (specify affected build below)
  • Ubuntu
  • Debian
  • Other (specify below)

Additional OS information

kqueue and epoll datapaths, in addition to PSN on windows

MsQuic version

main

Steps taken to reproduce bug

Race condition

Expected behavior

Sends can't hang

Actual outcome

Sends can hang

Additional details

The solution to this will be to always keep the edge triggers enabled. Then before we send, enqueue the send into the pending queue. If the send passes, dequeue it, otherwise just continue, and the datapath thread will pick up the send later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant