Failing to do so we might trigger the test in `MaintenanceTask.run()`
and find the pool closed, so discard the operation. It usually doesn't
happen, but with a few combination of IO operation it does happen: see
https://github.com/psycopg/psycopg/issues/230 for details.
``psycopg_pool`` release notes
==============================
+Future releases
+---------------
+
+psycopg_pool 3.1.1 (unreleased)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+- Fix race condition on pool creation which might result in the pool not
+ filling (:ticket:`#230`).
+
+
Current release
---------------
set to 0 (instead of hanging).
- Raise `PoolClosed` calling `~ConnectionPool.wait()` on a closed pool.
+
psycopg_pool 3.0.2
^^^^^^^^^^^^^^^^^^
self._check_open()
- self._start_workers()
- self._start_initial_tasks()
-
self._closed = False
self._opened = True
+ self._start_workers()
+ self._start_initial_tasks()
+
def _start_workers(self) -> None:
self._sched_runner = threading.Thread(
target=self._sched.run,
self._check_open()
- self._start_workers()
- self._start_initial_tasks()
-
self._closed = False
self._opened = True
+ self._start_workers()
+ self._start_initial_tasks()
+
def _start_workers(self) -> None:
self._sched_runner = create_task(
self._sched.run(), name=f"{self.name}-scheduler"