[Tile-serving] [osm2pgsql-dev/osm2pgsql] TLS issues with osm2pgsql-replication (Discussion #2273)

Goncalo Oliveira notifications at github.com
Wed Dec 11 08:52:50 UTC 2024


Ok, adding more details for whoever comes looking for a similar issue, although it has nothing to do with `osm2pgsql` directly.

> For the first issue related to the SSL connection being closed unexpectedly, this can occur when the application tries to reuse an idle connection after the Neon compute has been suspended due to inactivity. If you plan to leave a connection idle, it would be good to increment the auto-suspend timer to meet the duration needed, or disable it altogether. The default auto-suspend is 5 minutes, and looking at the endpoint activity, it is suspending roughly 5 minutes after opening.

This explains the behaviour... the connection is inactive for more than five minutes and when the application tries to use it again, it was already dropped. To clarify, in this context, we're talking about a direct connection, not through the connection pooler.
To workaround this, one can change the default inactivity timeout to a bigger value (Neon compute settings). Although this has nothing to do with `osm2pgsql` it would be interesting if it did have options for a health check or keep-alive mechanism to prevent this from happening.

Regarding the issues with the connection pool, I had opened an [issue](https://github.com/osm2pgsql-dev/osm2pgsql/issues/924) before (which I didn't remember). Neon uses `pgbouncer`, which doesn't support SQL prepared statements. It does however support protocol level prepared statements and there's already a [discussion](https://github.com/osm2pgsql-dev/osm2pgsql/discussions/2118) open requesting for its support.

Hope this helps anyone going through the same issues.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/discussions/2273#discussioncomment-11530369
You are receiving this because you are subscribed to this thread.

Message ID: <osm2pgsql-dev/osm2pgsql/repo-discussions/2273/comments/11530369 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20241211/ea3b482a/attachment.htm>


More information about the Tile-serving mailing list