You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
amends #675
to fully implement ADR 006, therefore introducing two new driver config options
`session_connection_timeout` and `update_routing_table_timeout`.
Related fixes in this PR:
* Fix pool._acquire
It should retry finding an idle connection after being woken up
Further small improvements:
* Extend concurrent pool tests by pre-populating the pool
* Fix missing `await` in `Bolt.ping`
* Fix overwriting socket wrapper's close mothod
* Fix ITs with Neo4j 5.0+: WAIT for async DB management queries
Copy file name to clipboardExpand all lines: docs/source/api.rst
+60-5Lines changed: 60 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -160,7 +160,8 @@ Driver Configuration
160
160
161
161
Additional configuration can be provided via the :class:`neo4j.Driver` constructor.
162
162
163
-
163
+
+ :ref:`session-connection-timeout-ref`
164
+
+ :ref:`update-routing-table-timeout-ref`
164
165
+ :ref:`connection-acquisition-timeout-ref`
165
166
+ :ref:`connection-timeout-ref`
166
167
+ :ref:`encrypted-ref`
@@ -175,12 +176,63 @@ Additional configuration can be provided via the :class:`neo4j.Driver` construct
175
176
+ :ref:`user-agent-ref`
176
177
177
178
179
+
.. _session-connection-timeout-ref:
180
+
181
+
``session_connection_timeout``
182
+
------------------------------
183
+
The maximum amount of time in seconds the session will wait when trying to
184
+
establish a usable read/write connection to the remote host.
185
+
This encompasses *everything* that needs to happen for this, including,
186
+
if necessary, updating the routing table, fetching a connection from the pool,
187
+
and, if necessary fully establishing a new connection with the reader/writer.
188
+
189
+
Since this process may involve updating the routing table, acquiring a
190
+
connection from the pool, or establishing a new connection, it should be chosen
191
+
larger than :ref:`update-routing-table-timeout-ref`,
192
+
:ref:`connection-acquisition-timeout-ref`, and :ref:`connection-timeout-ref`.
193
+
194
+
:Type: ``float``
195
+
:Default: ``120.0``
196
+
197
+
.. versionadded:: 4.4.5
198
+
199
+
.. versionchanged:: 5.0
200
+
201
+
The default value was changed from ``float("inf")`` to ``120.0``.
202
+
203
+
204
+
.. _update-routing-table-timeout-ref:
205
+
206
+
``update_routing_table_timeout``
207
+
--------------------------------
208
+
The maximum amount of time in seconds the driver will attempt to fetch a new
209
+
routing table. This encompasses *everything* that needs to happen for this,
210
+
including fetching connections from the pool, performing handshakes, and
211
+
requesting and receiving a fresh routing table.
212
+
213
+
Since this process may involve acquiring a connection from the pool, or
214
+
establishing a new connection, it should be chosen larger than
215
+
:ref:`connection-acquisition-timeout-ref` and :ref:`connection-timeout-ref`.
216
+
217
+
This setting only has an effect for :ref:`neo4j-driver-ref`, but not for
218
+
:ref:`bolt-driver-ref` as it does no routing at all.
219
+
220
+
:Type: ``float``
221
+
:Default: ``90.0``
222
+
223
+
.. versionadded:: 4.4.5
224
+
225
+
178
226
.. _connection-acquisition-timeout-ref:
179
227
180
228
``connection_acquisition_timeout``
181
229
----------------------------------
182
-
The maximum amount of time in seconds a session will wait when requesting a connection from the connection pool.
183
-
Since the process of acquiring a connection may involve creating a new connection, ensure that the value of this configuration is higher than the configured :ref:`connection-timeout-ref`.
230
+
The maximum amount of time in seconds the driver will wait to either acquire an
231
+
idle connection from the pool (including potential liveness checks) or create a
232
+
new connection when the pool is not full and all existing connection are in use.
233
+
234
+
Since this process may involve opening a new connection including handshakes,
235
+
it should be chosen larger than :ref:`connection-timeout-ref`.
184
236
185
237
:Type: ``float``
186
238
:Default: ``60.0``
@@ -190,7 +242,11 @@ Since the process of acquiring a connection may involve creating a new connectio
190
242
191
243
``connection_timeout``
192
244
----------------------
193
-
The maximum amount of time in seconds to wait for a TCP connection to be established.
245
+
The maximum amount of time in seconds to wait for a TCP connection to be
246
+
established.
247
+
248
+
This *does not* include any handshake(s), or authentication required before the
249
+
connection can be used to perform database related work.
194
250
195
251
:Type: ``float``
196
252
:Default: ``30.0``
@@ -224,7 +280,6 @@ Specify whether TCP keep-alive should be enabled.
224
280
225
281
``max_connection_lifetime``
226
282
---------------------------
227
-
228
283
The maximum duration in seconds that the driver will keep a connection for before being removed from the pool.
0 commit comments