Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix gtfs import: let pgbouncer close client connections on reconfiguration, other tweaks #79

Merged
merged 4 commits into from
Jan 16, 2024

Conversation

derhuerst
Copy link
Member

@derhuerst derhuerst commented Jan 12, 2024

342e0e7 is the actual fix, the other commits are related cleanups.

This PR is a workaround; When bitnami/containers#54732 is merged & shipped, we can remove the custom script and use just PGBOUNCER_SERVER_FAST_CLOSE: '1'.

@derhuerst derhuerst requested a review from hbruch January 12, 2024 16:35
@hbruch
Copy link
Collaborator

hbruch commented Jan 14, 2024

Thanks, LGTM.

This change will result in pgbouncer closing connections which still might be in idle sessions of clients, i.e. postgREST. Reading postgREST docs, I understand that postgREST will attempt an automatic recovery, so clients usually would not notice, right?

@derhuerst
Copy link
Member Author

This change will result in pgbouncer closing connections which still might be in idle sessions of clients, i.e. postgREST. Reading postgREST docs, I understand that postgREST will attempt an automatic recovery, so clients usually would not notice, right?

Yes, this is what I understood too, and while testing it locally, it seemed that this is the case. (I may have made a mistake trying to reproduce the case though.)

PostgREST uses a separate long-running (separate) DB connection to listen on a pub/sub channel for instructions to reload its schema (cache). By default, pgbouncer *does not* force-close idle connections on reconfigurations.

Although we recently configured pgbouncer to do so, we don't need this on-demand schema reloading feature anyways, so we turn it off.
@derhuerst derhuerst merged commit d8558f3 into main Jan 16, 2024
2 checks passed
@derhuerst derhuerst deleted the fix-gtfs-import branch January 16, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants