Shorten the unix socket path for shim#3046
Conversation
|
Thanks for working on this, but I think we should freeze v1 and prioritize v2 for this. |
As long as it's compatible, I think there is no harm for fixing v1 : ). This commit applies to v2 as well. |
|
e1bec35 to
e955e27
Compare
No, It was my fault. I didn't do well with the socket file in last commit that golang closed listener along with unlinking the socket file. I just re-push the new commit, please check it out.
As https://github.com/containerd/containerd/blob/master/sys/mount_linux.go#L93. Forking to implement socket(), bind(), listen() syscall is really tiresome.
May you provide the way to test it ? : ) |
e955e27 to
9bf769e
Compare
Codecov Report
@@ Coverage Diff @@
## master #3046 +/- ##
=======================================
Coverage 43.46% 43.46%
=======================================
Files 103 103
Lines 11033 11033
=======================================
Hits 4795 4795
Misses 5503 5503
Partials 735 735
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #3046 +/- ##
==========================================
- Coverage 43.4% 43.39% -0.01%
==========================================
Files 104 104
Lines 11096 11097 +1
==========================================
Hits 4816 4816
- Misses 5544 5545 +1
Partials 736 736
Continue to review full report at Codecov.
|
fuweid
left a comment
There was a problem hiding this comment.
- no shim v2 change here
runtime/v2/shim/util_unix.go - update your commit message because there is still abstract socket
9bf769e to
da8fe5a
Compare
Fixed, thanks |
|
@linxiulei I think we can also add test case for regression :p |
da8fe5a to
d1f8d4c
Compare
runtime/v1/shim/client/client.go
Outdated
There was a problem hiding this comment.
could we create the same function for this? I think v1 should not import v2 package here. WDYT?
There was a problem hiding this comment.
Yes, this sounds good, just copy the function
runtime/v1/linux/bundle.go
Outdated
There was a problem hiding this comment.
I think we should return legacyone if the err is not nil(notfound), right?
There was a problem hiding this comment.
This logic looks wrong here. We should handle an os.IsNotExist errror and then call legacyShimAddress
There was a problem hiding this comment.
Just asking,if err == IsNotExist, the returning address would be empty, it seems we pass a potential err to Connect
There was a problem hiding this comment.
I think it is fine to ignore the error here.
If we want to know what the error is, the log seems the way. But there is no ctx pass-through var, and we should use log.G(context.TODO()). I don't know it is good way to add it.
There was a problem hiding this comment.
this handling still looks wrong. if we get an error here then you should be returning the legacy address right?!
aa22c04 to
dfd6aae
Compare
aac643d to
a950d4e
Compare
Use sha256 hash to shorten the unix socket path to satisfy the length limitation of abstract socket path This commit also backports the feature storing address path to a file from v2 to keep compatibility Fixes containerd#3032 Signed-off-by: Eric Lin <linxiulei@gmail.com>
a950d4e to
a631796
Compare
|
|
||
| func (b *bundle) decideShimAddress(namespace string) string { | ||
| address, err := b.loadAddress() | ||
| if err != nil { |
There was a problem hiding this comment.
let's handle the error in next pr :)
|
LGTM |
Use sha256 hash to shorten the unix socket path to satisfy the
length limitation of abstract socket path
This commit also backports the feature storing address path to
a file from v2 to keep compatibility
Fixes #3032
Signed-off-by: Eric Lin linxiulei@gmail.com