Skip to content

Commit 4ec01d2

Browse files
committed
fix(cubesq): Ignore BrokenPipe/UnexpectedEOF as error in pg-wire
1 parent a87e9cf commit 4ec01d2

File tree

1 file changed

+11
-1
lines changed
  • rust/cubesql/cubesql/src/sql/postgres

1 file changed

+11
-1
lines changed

rust/cubesql/cubesql/src/sql/postgres/shim.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{backtrace::Backtrace, collections::HashMap, sync::Arc};
1+
use std::{backtrace::Backtrace, collections::HashMap, io::ErrorKind, sync::Arc};
22

33
use super::extended::PreparedStatement;
44
use crate::{
@@ -191,6 +191,16 @@ impl AsyncPostgresShim {
191191

192192
match shim.run().await {
193193
Err(e) => {
194+
if let ConnectionError::Protocol(ProtocolError::IO { source, .. }) = &e {
195+
if source.kind() == ErrorKind::BrokenPipe
196+
|| source.kind() == ErrorKind::UnexpectedEof
197+
{
198+
trace!("Error during processing PostgreSQL connection: {}", e);
199+
200+
return Ok(());
201+
}
202+
}
203+
194204
shim.logger.error(
195205
format!("Error during processing PostgreSQL connection: {}", e).as_str(),
196206
None,

0 commit comments

Comments
 (0)