Skip to content

Conversation

adk-swisstopo
Copy link
Member

Before this change we were using psycopg 2.9.10. This does not seem to be designed to work correctly with gevent "out of the box". The psycogreen library was written to resolve that problem but we don't seem to be using it at all.

Upgrading to psycopg 3 allows proper integration with gevent without psycogreen or other workaround.

This change upgrades service-stac from psycopg 2.9.10 to 3.2.9. This was done by updating the Pipfile then running pipenv install. This also updated other dependencies.

In local tests, I verified the /checker endpoint remains much more responsive with this change when end-to-end tests are being run. Maximum measured latency dropped from ~15 seconds to ~3 seconds.

Before this change we were using psycopg 2.9.10. This does not seem to be
designed to [work correctly with gevent](https://www.psycopg.org/docs/advanced.html#support-for-coroutine-libraries) "out of the box".
The [psycogreen](https://github.com/psycopg/psycogreen/) library was written to
resolve that problem but we don't seem to be using it at all.

Upgrading to [psycopg 3 allows proper integration with gevent](https://www.psycopg.org/psycopg3/docs/advanced/async.html#gevent-support) without psycogreen or other workaround.

This change upgrades service-stac from psycopg 2.9.10 to 3.2.9. This was done by
updating the Pipfile then running `pipenv install`. This also updated other
dependencies.

In local tests, I verified the `/checker` endpoint remains much more responsive
with this change when end-to-end tests are being run. Maximum measured latency
dropped from ~15 seconds to ~3 seconds.
@adk-swisstopo adk-swisstopo requested a review from msom July 9, 2025 08:31
@github-actions github-actions bot added the bug label Jul 9, 2025
Copy link
Contributor

@msom msom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@adk-swisstopo adk-swisstopo merged commit c5e2e6e into develop Jul 9, 2025
3 checks passed
@adk-swisstopo adk-swisstopo deleted the fix-PB-1785-psycopg branch July 9, 2025 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants