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

100% CPU usage after connection lost while sending large amount of data #401

Closed
PonyPC opened this issue Dec 1, 2024 · 2 comments
Closed

Comments

@PonyPC
Copy link

PonyPC commented Dec 1, 2024

100% CPU usage after connection lost while sending large amount of data

The issue is in

// TODO fix this busywait

It won't triggle connection lost event.

@EpicEric
Copy link
Contributor

EpicEric commented Dec 2, 2024

Shouldn't this trigger an Err(BrokenPipe)? Or am I missing some other way that would lead to the condition being reached?

@PonyPC
Copy link
Author

PonyPC commented Dec 3, 2024

Nothing triggered. If you add a check like:

            if self.sender.is_closed() {
                return Poll::Ready((ChannelMsg::Eof, 0));
            }

It only mitigates the tcp has a connection lost event. But when you try it such as blocking the connection by using a firewall realtime rules, the CPU usage is still high until tcp timeout error. As it not sufficient on dealing with sending data, is there any other ways to eliminate this situation?

Eugeny added a commit that referenced this issue Dec 4, 2024
Eugeny pushed a commit that referenced this issue Dec 5, 2024
Eugeny added a commit that referenced this issue Dec 7, 2024
Co-authored-by: Eric Rodrigues Pires <eric@eric.dev.br>
@Eugeny Eugeny closed this as completed Dec 7, 2024
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

No branches or pull requests

3 participants