Skip to content

Feature pg8000 graceful shutdown#4457

Open
panish16 wants to merge 17 commits into
bcgov:feature-pg8000-graceful-shutdownfrom
panish16:feature-pg8000-graceful-shutdown
Open

Feature pg8000 graceful shutdown#4457
panish16 wants to merge 17 commits into
bcgov:feature-pg8000-graceful-shutdownfrom
panish16:feature-pg8000-graceful-shutdown

Conversation

@panish16
Copy link
Copy Markdown
Contributor

@panish16 panish16 commented Jun 3, 2026

Issue #: /bcgov/entity###

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).

panish16 added 17 commits May 27, 2026 09:39
Calls setup_pg8000_close_event_listener(engine) after db init in all
lear queue services and legal-api. Scoped to long-lived Cloud Run
services only — GCP jobs excluded as no pg8000 errors observed in logs.

Resolves #33564
… blocks

Remove the DBConfig blocks from all 5 queue services (business-bn, business-emailer,
business-pay, business-filer, business-digital-credentials). These services connect
via SQLALCHEMY_DATABASE_URI in their configs and don't need Cloud SQL Connector
connection pooling. The setup_pg8000_close_event_listener call is now unconditional
since the function already returns early for non-pg8000 engines.
…listener

DBConfig/SQLALCHEMY_ENGINE_OPTIONS setup was removed from __init__.py without
being moved anywhere, breaking Cloud SQL connections on GCP. Move it into each
service's config.py alongside the existing CLOUDSQL_INSTANCE_CONNECTION_NAME
block. Replace legal-api's local _setup_pg8000_graceful_shutdown reimplementation
with setup_pg8000_close_event_listener from cloud_sql_connector.
…s updated

setup_pg8000_close_event_listener is not yet available on the
cloud-sql-connector-python3.9 branch used by legal-api, so retain the
local _setup_pg8000_graceful_shutdown implementation. DBConfig setup
remains moved to config.py.
…dentials so coverage.xml is generated and uploaded
Python 3.9 branch of sbc-connect-common does not have
setup_pg8000_close_event_listener. Restore the local
_setup_pg8000_graceful_shutdown function and point the lock back to the
valid bcgov commit (e82cd710) so the Docker build can clone the
dependency.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 3, 2026

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.

1 participant