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
sk-tcp: Improve TCP socket options handling #2380
sk-tcp: Improve TCP socket options handling #2380
Conversation
c1ada6c
to
7f2404c
Compare
7f2404c
to
872809c
Compare
872809c
to
369b491
Compare
369b491
to
bcfbc64
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## criu-dev #2380 +/- ##
============================================
- Coverage 70.73% 70.58% -0.15%
============================================
Files 136 135 -1
Lines 32940 33462 +522
============================================
+ Hits 23299 23620 +321
- Misses 9641 9842 +201 ☔ View full report in Codecov by Sentry. |
I see that code linter fails, but I don't seem to find the EOL whitespace problem in sk-inet.c? |
bcfbc64
to
859800b
Compare
It seems that the CRIU Image Streamer Test is stuck in the zdtm/transition/socket_loop00 test case. But the zdtm/transition/socket_loop00 test case can end normally and pass on my computer. |
Don't worry. The image streamer tests are known to timeout sometimes. |
@juntongdeng Could you please add a comment in the code before restoring TcpStreamEntry and SkOptsEntry that this is done for backward comparability, and newer versions of CRIU use TcpOptsEntry? |
Yes, will do |
A friendly reminder that this PR had no activity for 30 days. |
Currently some of the TCP socket option information is stored in the TcpStreamEntry, but the information in the TcpStreamEntry is only restored after the TCP socket has established connection, which results in these TCP socket options not being restored for unconnected TCP sockets. In this commit move the TCP socket options from TcpStreamEntry to TcpOptsEntry and add dump_tcp_opts() and restore_tcp_opts() for TCP socket options dump and restore. Signed-off-by: Juntong Deng <juntong.deng@outlook.com>
Currently some TCP socket option information is stored in SkOptsEntry, which is a little confusing. SkOptsEntry should only contain socket options that are common to all sockets. In this commit move the TCP-specific socket options from SkOptsEntry to TcpOptsEntry. Signed-off-by: Juntong Deng <juntong.deng@outlook.com>
Currently there are no socket option test cases for TCP_CORK and TCP_NODELAY, this commit adds related test cases. The socket option test cases for TCP_KEEPCNT, TCP_KEEPIDLE, and TCP_KEEPINTVL already exist in socket-tcp_keepalive.c, so they are not included in this test case. Signed-off-by: Juntong Deng <juntong.deng@outlook.com>
859800b
to
7d06fb0
Compare
fixed |
How to remove "stale-pr" label? |
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.
Looks good.
Test fails seem to be unrelated:
-
Cirrus CI / Vagrant Fedora Rawhide based test
https://github.com/checkpoint-restore/criu/pull/2380/checks?check_run_id=25148861695
Error issetenforce: SELinux is disabled
, seems like we just have selinux disabled in kernel in this env. Does not seem to be related socket opritons or this PR. -
Cross Compile Tests / build (true, mips64el-unstable-cross)
https://github.com/checkpoint-restore/criu/actions/runs/9147441768/job/25160880160?pr=2380
Error isERROR: failed to solve: process "/bin/sh -c apt-install ...
, seems like a package install problem. Does not seem to be related to this PR. -
Compat Tests / build (GCC)
https://github.com/checkpoint-restore/criu/actions/runs/9147441773/job/25160879538?pr=2380
Error isFAIL: vdso01.c:434: Failed to call vdso handlers from symtable after C/R (errno = 11 (Resource temporarily unavailable))
, I see same error in other PR CI. (ERR: vdso01.c:378: Delta is too big #2390)
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
Merged. Thanks a lot. |
This pull request improves the dumping and restoring of TCP socket options in CRIU.
Currently some of the TCP socket option information is stored in the TcpStreamEntry, but the information in the TcpStreamEntry is only restored after the TCP socket has established connection, which results in these TCP socket options not being restored for unconnected TCP sockets.
Move the TCP socket options from TcpStreamEntry to TcpOptsEntry and add dump_tcp_opts() and restore_tcp_opts() for TCP socket options dump and restore.
Currently some TCP socket option information is stored in SkOptsEntry, which is a little confusing. SkOptsEntry should only contain socket options that are common to all sockets.
Move the TCP-specific socket options from SkOptsEntry to TcpOptsEntry.
Currently there are no socket option test cases for TCP_CORK and TCP_NODELAY, this commit adds related test cases.
The socket option test cases for TCP_KEEPCNT, TCP_KEEPIDLE, and TCP_KEEPINTVL already exist in socket-tcp_keepalive.c, so they are not included in this pull request.