emews / EQ-SQL

1 stars 0 forks source link

Harden connection creation against max connection errors #29

Closed ncollier closed 1 year ago

ncollier commented 2 years ago

postgres will refuse new connection requests with "Error: FATAL: sorry, too many clients already". Update the init() code in both APIs to retry if connection is refused.

ncollier commented 2 years ago

Thinking this through -- this is unlikely to occur. An ME would require a single connection and the worker pool has a single connection for the worker pool. Probably still useful to retry but not urgent.

ncollier commented 2 years ago

This is important in the asynch user case where each worker in a worker pool reports it result asynchronously. Python implementation has a connection retry implementation, but this needs to be done in R. See the connection tests for an initial R implementation.

ncollier commented 1 year ago

Fixed in R now that it's using Python implementation