Minor refactor for configs (#172)

* Changes shard struct to use vector of ServerConfig

* Adds to query router

* Change client disconnect with error message to warn instead of debug

* Add warning logs for clean up actions
This commit is contained in:
zainkabani
2022-09-22 13:07:02 -04:00
committed by GitHub
parent 85cc2f4147
commit 3a729bb75b
5 changed files with 32 additions and 39 deletions

View File

@@ -591,6 +591,7 @@ impl Server {
// server connection thrashing if clients repeatedly do this.
// Instead, we ROLLBACK that transaction before putting the connection back in the pool
if self.in_transaction() {
warn!("Server returned while still in transaction, rolling back transaction");
self.query("ROLLBACK").await?;
}
@@ -600,6 +601,7 @@ impl Server {
// send `DISCARD ALL` if we think the session is altered instead of just sending
// it before each checkin.
if self.needs_cleanup {
warn!("Server returned with session state altered, discarding state");
self.query("DISCARD ALL").await?;
self.needs_cleanup = false;
}