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:
Mostafa Abdelraouf
2022-08-23 13:02:23 -05:00
committed by GitHub
parent 5a0cea6a24
commit c054ff068d
3 changed files with 106 additions and 30 deletions

View File

@@ -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;
}
};