-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Introduce os_fd_t and windows port of os_sys_calls_impl #10036
Conversation
- Add os_fd_t as the new data type for os_sys_calls socket methods - Add SysCallSocketResult of that data type - Normalize and "const-ify" all usage of iovec and msghdr types - Add additional os_sys_calls methods all required for porting the various test/ sources to Windows in subsequent PRs Co-authored-by: Sunjay Bhatia <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]>
Co-authored-by: Sunjay Bhatia <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done. I have some mostly-style related comments below.
One question I have is whether our existing tests are sufficient to exercise all the glue code in win32/os_sys_calls_impl.cc? Specifically, I worry there are some network errors that aren't exercised by our tests or subtle behavioral differences when converting between iovec and WSABUF.
Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]>
It wasn't, nor was the existing posix implementation. That patch is coming in the next PR. |
/retest |
🔨 rebuilding |
test passes locally but failed in CI, just retesting to make sure |
- Collapse panics - rename to with a more envoy-style name Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]>
Signed-off-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]>
- errno is only reset if the previous syscall failed, in the case where the return code is 0, we may still be returning non-zero errno - callers should be checking the rc before looking at errno, but this is a cleanup to ensure they can never see an erroneous errno on success of a syscall Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]>
Should be SysCallSocketResult Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]>
- The test class has an os_sys_calls mock member that is injected as a singleton, use that where needed - Use new macros for socket validity Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]>
Signed-off-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]>
In our efforts to try to resolve the circle CI failure, we noticed we could reduce the relevant test file and did so in: 6b5d982 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo some style nits.
- snake case all variables - no static in anonymous namespace - get rid of redundant std::move Signed-off-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]>
Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]>
retesting due to coverage tests segfault (same as #10012) /retest |
🔨 rebuilding |
retesting (again) due to coverage tests segfault (same as #10012) /retest |
🔨 rebuilding |
@zuercher looks like we just keep failing on #10012, should we continue to retest until it passes? a previous commit before some windows-only changes had this pass (see: https://github.com/envoyproxy/envoy/pull/10036/commits, specifically commit 5f78ad3) |
We can merge w/o coverage passing until we fix it. cc @lizan |
Description:
necessary to port to windows, where SOCKET is 2x width of an int
the various test/ sources to Windows in subsequent PRs
This patch defers the actual work of employing the os_sys_calls API
where needed for Windows, which is a much more involved PR review.
Risk Level: Moderate
Testing: local on linux gcc, windows msvc
Docs Changes: n/a
Release Notes: n/a