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

fix(postgres): avoid unnecessary flush in PgCopyIn::read_from #2932

Merged
merged 1 commit into from
Jan 6, 2024

Conversation

jwangnz
Copy link
Contributor

@jwangnz jwangnz commented Dec 12, 2023

This pull request addresses a potential hang in PgCopyIn::read_from caused by conn.stream.flush().await?;. The flush call appears to be unnecessary at this point, as the write buffer has already been flushed in PgCopyIn::begin.

@abonander
Copy link
Collaborator

I agree that the flush is arguably unnecessary but I'm more interested in why it would hang. It should return immediately if there's nothing to flush.

Do you have a reliable reproduction for this?

@abonander
Copy link
Collaborator

Are you using rustls or native-tls?

@jwangnz
Copy link
Contributor Author

jwangnz commented Dec 16, 2023

@abonander we are using rustls, and unfortunately I don't have way to reproduce it yet. We have three environments using the same binary with the same version of AWS RDS for Postgres, but only one has this issue.

@abonander abonander merged commit ea4703e into launchbadge:main Jan 6, 2024
64 checks passed
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 this pull request may close these issues.

2 participants