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

Set TCP listener created sockets to non blocking #4541

Merged
merged 12 commits into from
Sep 10, 2024

Conversation

ThadHouse
Copy link
Contributor

Description

TCP listener sockets on linux were not set to non-blocking. So they'd block on read 😱

Built on top of #4537 as I'm interacting at the exact same point. See the fcntl call.

Testing

I'm trying to figure out how to write a test for this. I have an idea, but not sure the right variables are exposed to the test framework.

Documentation

N/A

@ThadHouse ThadHouse requested a review from a team as a code owner September 9, 2024 07:41
@nibanks nibanks added external Proposed by non-MSFT Bug: Platform A code bug in platform/TLS specific code. labels Sep 9, 2024
@nibanks
Copy link
Member

nibanks commented Sep 9, 2024

There are conflicts that must be resolved, AND these build errors:

/__w/msquic/msquic/src/platform/datapath_epoll.c: In function 'CxPlatSocketContextAcceptCompletion':
/__w/msquic/msquic/src/platform/datapath_epoll.c:1582:9: error: implicit declaration of function 'fcntl' [-Werror=implicit-function-declaration]
 1582 |         fcntl(
      |         ^~~~~
/__w/msquic/msquic/src/platform/datapath_epoll.c:1584:13: error: 'F_SETFL' undeclared (first use in this function)
 1584 |             F_SETFL, fcntl(SocketContext->AcceptSocket->SocketContexts[0].SocketFd, F_GETFL, 0) | O_NONBLOCK);
      |             ^~~~~~~
/__w/msquic/msquic/src/platform/datapath_epoll.c:1584:13: note: each undeclared identifier is reported only once for each function it appears in
/__w/msquic/msquic/src/platform/datapath_epoll.c:1584:85: error: 'F_GETFL' undeclared (first use in this function)
 1584 |             F_SETFL, fcntl(SocketContext->AcceptSocket->SocketContexts[0].SocketFd, F_GETFL, 0) | O_NONBLOCK);
      |                                                                                     ^~~~~~~
/__w/msquic/msquic/src/platform/datapath_epoll.c:1584:99: error: 'O_NONBLOCK' undeclared (first use in this function); did you mean 'EFD_NONBLOCK'?
 1584 |             F_SETFL, fcntl(SocketContext->AcceptSocket->SocketContexts[0].SocketFd, F_GETFL, 0) | O_NONBLOCK);
      |                                                                                                   ^~~~~~~~~~
      |                                                                                                   EFD_NONBLOCK

@ThadHouse
Copy link
Contributor Author

Merged and fixed.

nibanks
nibanks previously approved these changes Sep 9, 2024
Copy link

codecov bot commented Sep 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.83%. Comparing base (376265a) to head (863573d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4541      +/-   ##
==========================================
+ Coverage   85.08%   85.83%   +0.74%     
==========================================
  Files          56       56              
  Lines       15537    15537              
==========================================
+ Hits        13220    13336     +116     
+ Misses       2317     2201     -116     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nibanks
Copy link
Member

nibanks commented Sep 9, 2024

More build failures:

/home/runner/work/msquic/msquic/src/platform/datapath_epoll.c: In function ‘CxPlatSocketContextAcceptCompletion’:
/home/runner/work/msquic/msquic/src/platform/datapath_epoll.c:1585:5: error: ‘Flags’ undeclared (first use in this function)
 1585 |     Flags =
      |     ^~~~~
/home/runner/work/msquic/msquic/src/platform/datapath_epoll.c:1585:5: note: each undeclared identifier is reported only once for each function it appears in
/home/runner/work/msquic/msquic/src/platform/datapath_epoll.c:1615:9: error: label ‘Exit’ used but not defined
 1615 |         goto Exit;
      |         ^~~~

nibanks
nibanks previously approved these changes Sep 9, 2024
@ThadHouse
Copy link
Contributor Author

Ill fix the break tonight.

@nibanks nibanks merged commit 44f096a into microsoft:main Sep 10, 2024
469 of 471 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Platform A code bug in platform/TLS specific code. external Proposed by non-MSFT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants