mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-24 09:46:29 +00:00
Avoid sending Z packet in the middle of extended protocol packet sequence if we fail to get connection from pool (#137)
* Failing test * maybe * try fail * try * add message * pool size * correct user * more * debug * try fix * see stdout * stick? * fix configs * modify * types * m * maybe * make tests idempotent * hopefully fails * Add client fix * revert pgcat.toml change * Fix tests
This commit is contained in:
committed by
GitHub
parent
5a0cea6a24
commit
c054ff068d
@@ -643,9 +643,20 @@ where
|
||||
conn
|
||||
}
|
||||
Err(err) => {
|
||||
error!("Could not get connection from pool: {:?}", err);
|
||||
error_response(&mut self.write, "could not get connection from the pool")
|
||||
.await?;
|
||||
// Clients do not expect to get SystemError followed by ReadyForQuery in the middle
|
||||
// of extended protocol submission. So we will hold off on sending the actual error
|
||||
// message to the client until we get 'S' message
|
||||
match message[0] as char {
|
||||
'P' | 'B' | 'E' | 'D' => (),
|
||||
_ => {
|
||||
error!("Could not get connection from pool: {:?}", err);
|
||||
error_response(
|
||||
&mut self.write,
|
||||
"could not get connection from the pool",
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user