Skip to content

socketpair_windows: remove implementation for now#69

Merged
fuweid merged 1 commit intocontainerd:mainfrom
champtar:multiple-close-windows
Feb 3, 2024
Merged

socketpair_windows: remove implementation for now#69
fuweid merged 1 commit intocontainerd:mainfrom
champtar:multiple-close-windows

Conversation

@champtar
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@klihub
Copy link
Copy Markdown
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 fuweid and klihub February 1, 2024 11:33
@champtar
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

champtar commented Feb 2, 2024

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

@klihub
Copy link
Copy Markdown
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
Copy Markdown
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

@champtar champtar force-pushed the multiple-close-windows branch from 42137ec to 25d041e Compare February 3, 2024 06:31
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
Copy Markdown

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 force-pushed the multiple-close-windows branch from 25d041e to e47f09b Compare February 3, 2024 06:35
@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
Copy Markdown
Contributor Author

champtar commented Feb 3, 2024

@klihub new version just returning an error

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@fuweid
Copy link
Copy Markdown
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.

4 participants