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

Data channel commands aren't flushed, so the check to see if the connection is healthy doesn't always work #317

Open
RyanAD opened this issue Dec 21, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@RyanAD
Copy link
Contributor

RyanAD commented Dec 21, 2023

I've run into issues where the data channel was unhealthy, but it wasn't detected with this check:

if ch.write_all(&cmd).await.is_ok() {
    tokio::spawn(async move {
        let _ = copy_bidirectional(&mut ch, &mut visitor).await;
    });
    break;
} else {
    // Current data channel is broken. Request for a new one
    if data_ch_req_tx.send(true).is_err() {
        break 'pool;
    }
}

Ultimately it was because the ch.write_all(&cmd) may not cause the buffer to be flushed. The cause of this is that the connection is assumed healthy, but then fails during copy_bidirectional. It also means the TCP connection pool won't always be the correct size.

I've implemented the fix that is working for me in this PR: #316

@RyanAD RyanAD added the bug Something isn't working label Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant