Update pool.py - #828
Conversation
Use if instead of a try / except loop to avoid circular call
|
I have trouble reproducing the bug. Our setup is quite complex, and I manage to produce the bug, but not every time and not at the same time ... I am trying to corner the bug better, but for now I can't give you a minimal example |
|
further query to the DB fails sql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: sorry, too many clients already |
|
ah, very good. so, if we limit the resources artificially, we should be able to produce a test that presents the same behavior. |
|
Yes, we're not seeing it in the prod postgresql VM, we tracked the Postgresql connections (with : The "too many connections" error ends up killing the irods process though We updated postgresql to 17 without changing the issue |
I suspect killing the db and trying a request from the python client is enough to reproduce the long traceback at the origin of the issue |
oh, yes, that might do it. definitely not something we've tested before. |
|
So, we appear to have fixed the problem with a strict reuse of the session for each 'agent', so: class iRODSAgent:
...
def __enter__(self):
super().__enter__()
self.session = irods_conn(self.conf)
return self
def __exit__(self, exc_type, exc_value, traceback):
self.session.cleanup()
super().__exit__(exc_type, exc_value, traceback)What create zombie session is doing something like: # Within the agent class
def do_smthg(self):
session = iRODSSession(...)
session.do_something()and not # Within the agent class
def do_smthg(self):
self.session.do_something()Fewww ^^' |
|
So I see two things that work?
|


Use if instead of a try / except loop to avoid circular call, see #827