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

Once an accept fails, the server will exit #239

Closed
quanweiZhou opened this issue Sep 23, 2024 · 0 comments · Fixed by #240
Closed

Once an accept fails, the server will exit #239

quanweiZhou opened this issue Sep 23, 2024 · 0 comments · Fixed by #240
Assignees

Comments

@quanweiZhou
Copy link
Collaborator

Description of problem

The current process will exit the loop if Accept fails once, causing all subsequent links to fail to accept.
https://github.com/containerd/ttrpc-rust/blob/v0.5.7/src/sync/server.rs#L426

        let handler = thread::Builder::new()
            .name("listener_loop".into())
            .spawn(move || {
                ...

                loop {
                    ...

                    #[cfg(target_os = "linux")]
                    let fd = match accept4(listener, SockFlag::SOCK_CLOEXEC) {
                        Ok(fd) => fd,
                        Err(e) => {
                            error!("failed to accept error {:?}", e);
                            break;
                        }
                    };

                    ...
            })
            .unwrap();

Expected result

If the Accept error occurs, an error can be output to ensure that the subsequent connect can be accepted normally.

Actual result

If the Accept error is detected, the loop will be exited, causing subsequent requests to fail to be accepted.

quanweiZhou added a commit to quanweiZhou/ttrpc-rust that referenced this issue Sep 23, 2024
If the Accept error occurs, an error can be output to ensure that the
subsequent connect can be accepted normally.

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
quanweiZhou added a commit to quanweiZhou/ttrpc-rust that referenced this issue Sep 23, 2024
If the Accept error occurs, an error can be output to ensure that the
subsequent connect can be accepted normally.

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
quanweiZhou added a commit to quanweiZhou/ttrpc-rust that referenced this issue Sep 23, 2024
If the Accept error occurs, an error can be output to ensure that the
subsequent connect can be accepted normally.

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
quanweiZhou added a commit to quanweiZhou/ttrpc-rust that referenced this issue Sep 23, 2024
If the Accept error occurs, an error can be output to ensure that the
subsequent connect can be accepted normally.

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
quanweiZhou added a commit to quanweiZhou/ttrpc-rust that referenced this issue Sep 23, 2024
If the Accept error occurs, an error can be output to ensure that the
subsequent connect can be accepted normally.

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
quanweiZhou added a commit to quanweiZhou/ttrpc-rust that referenced this issue Sep 23, 2024
If the Accept error occurs, an error can be output to ensure that the
subsequent connect can be accepted normally.

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
quanweiZhou added a commit to quanweiZhou/ttrpc-rust that referenced this issue Sep 23, 2024
If the Accept error occurs, an error can be output to ensure that the
subsequent connect can be accepted normally.

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
quanweiZhou added a commit to quanweiZhou/ttrpc-rust that referenced this issue Sep 23, 2024
If the Accept error occurs, an error can be output to ensure that the
subsequent connect can be accepted normally.

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
quanweiZhou added a commit to quanweiZhou/ttrpc-rust that referenced this issue Sep 23, 2024
If the Accept error occurs, an error can be output to ensure that the
subsequent connect can be accepted normally.

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
quanweiZhou added a commit to quanweiZhou/ttrpc-rust that referenced this issue Sep 23, 2024
If the Accept error occurs, an error can be output to ensure that the
subsequent connect can be accepted normally.

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
quanweiZhou pushed a commit to quanweiZhou/ttrpc-rust that referenced this issue Sep 23, 2024
update for fmt

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
quanweiZhou pushed a commit to quanweiZhou/ttrpc-rust that referenced this issue Sep 23, 2024
update for fmt

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
quanweiZhou added a commit to quanweiZhou/ttrpc-rust that referenced this issue Sep 23, 2024
If the Accept error occurs, an error can be output to ensure that the
subsequent connect can be accepted normally.

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
quanweiZhou added a commit to quanweiZhou/ttrpc-rust that referenced this issue Sep 24, 2024
If the Accept error occurs, an error can be output to ensure that the
subsequent connect can be accepted normally.

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
quanweiZhou added a commit to quanweiZhou/ttrpc-rust that referenced this issue Sep 24, 2024
If the Accept error occurs, an error can be output to ensure that the
subsequent connect can be accepted normally.

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
jokemanfire pushed a commit to jokemanfire/ttrpc-rust that referenced this issue Sep 27, 2024
If the Accept error occurs, an error can be output to ensure that the
subsequent connect can be accepted normally.

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
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 a pull request may close this issue.

3 participants