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

socketpair_windows: remove implementation for now #69

Merged
merged 1 commit into from
Feb 3, 2024

Conversation

champtar
Copy link
Contributor

@champtar champtar commented Jan 31, 2024

Current implementation has the same issues that
socketpair_unix.go had, namely double closes and
leaking FDs. The initial author prefers to remove
the code for now as the whole feature (NRI) doesn't
work on windows for now.

This allows us to rename socketpair_unix.go -> socketpair.go
as everything in it is generic.

@champtar
Copy link
Contributor Author

@klihub if you know who to ping for windows review / testing

@klihub
Copy link
Member

klihub commented Feb 1, 2024

@klihub if you know who to ping for windows review / testing

I don't know whom we could ping about Windows-related stuff, sans git-blaming the Windows-specific bits in the containerd and picking folks based on that. Personally, I'd be ready/glad to merge this. Looking at the changes I can't really see this breaking anything that wouldn't be already broken. Also, we don't have Windows support in NRI core.

@fuweid WDYT ?

@klihub klihub requested review from klihub and fuweid February 1, 2024 11:33
@champtar
Copy link
Contributor Author

champtar commented Feb 1, 2024

If someone can just launch the socketpair_test on a windows machine before merging (I don't have access to a windows box)

@champtar
Copy link
Contributor Author

champtar commented Feb 2, 2024

Looking at containerd git log, maybe @dmcgowan can also review this ?

@klihub
Copy link
Member

klihub commented Feb 2, 2024

If someone can just launch the socketpair_test on a windows machine before merging (I don't have access to a windows box)

It does not work, but it is not the fault of this PR. It was already broken. If we need/want to get NRI working on Windows, it will require bigger windows-specific changes, because there are other problems, too. For instance, the way how we try to pass the socket to a prelaunched plugin (exec/cmd.Command()'s ExtraFiles) is documented not to work on Windows.

I'm not sure what to do with this. Maybe we should return an error instead in newSocketpairCLOEXEC for windows and add a comment there documenting that this will require more work and platform-specific code on Windows...

@champtar WDYT ?

@champtar
Copy link
Contributor Author

champtar commented Feb 2, 2024

@klihub I'm fine just having a stub returning an error for windows, just like what is commented at the start of NewSocketPair

Current implementation has the same issues that
socketpair_unix.go had, namely double closes and
leaking FDs. The initial author prefers to remove
the code for now as the whole feature (NRI) doesn't
work on windows for now.

This allows us to rename socketpair_unix.go -> socketpair.go
as everything in it is generic.

Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
@codecov-commenter
Copy link

codecov-commenter commented Feb 3, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (4298b41) 64.58% compared to head (269bae5) 64.44%.
Report is 5 commits behind head on main.

❗ Current head 269bae5 differs from pull request most recent head e47f09b. Consider uploading reports for the commit e47f09b to get more accurate results

Files Patch % Lines
pkg/adaptation/adaptation.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #69      +/-   ##
==========================================
- Coverage   64.58%   64.44%   -0.14%     
==========================================
  Files          10       10              
  Lines        1838     1845       +7     
==========================================
+ Hits         1187     1189       +2     
- Misses        500      505       +5     
  Partials      151      151              

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

@champtar champtar changed the title socketpair_windows: avoid double close(), WSA_FLAG_NO_HANDLE_INHERIT socketpair_windows: remove implementation for now Feb 3, 2024
@champtar
Copy link
Contributor Author

champtar commented Feb 3, 2024

@klihub new version just returning an error

Copy link
Member

@klihub klihub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you ! LGTM.

@champtar
Copy link
Contributor Author

champtar commented Feb 3, 2024

BTW once this is merged can we have a new tag on this repo so we can fix containerd ?

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry for late reply

@fuweid fuweid merged commit bac4892 into containerd:main Feb 3, 2024
8 checks passed
@fuweid
Copy link
Member

fuweid commented Feb 3, 2024

@champtar https://github.com/containerd/nri/releases/tag/v0.6.0 done
cc @klihub

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.

None yet

4 participants