-
Notifications
You must be signed in to change notification settings - Fork 8
Description
The historical code for the dispatcher Control
operations did nothing asyncio, and avoided creating a new connection.
Some time around 8abf22b, I changed the pattern to creating a new connection, due to the unavoidable performance problems with the Django connection we're given. In AWX we have very custom stuff to wait for new notifications up until a timeout.
However, AWX appears to be doing things incorrectly in that the pg_bus_conn
never uses the .unlisten
method. It does close a connection if it created a new connection, but this isn't enough. With a new connection, you keep the connection, but you need to unsubscribe from all the pg_notify channels.
To get a solution for a timeout, maybe a simple ordinary python thread would be the right solution.
I'm thinking that testing this will involve creating a new "test_app" type Django app using the existing authentication to the existing database, because any tables it creates are non-conflicting with pg_notify channels.