Commit 67778d8
committed
fix: use reactor-aware executor factory for control-connection paging, fix mock contract and lint issue
- ControlConnection._try_connect and _refresh_node_list_and_token_map now
build their paging ThreadPoolExecutor via Cluster._create_thread_pool_executor
instead of instantiating concurrent.futures.ThreadPoolExecutor directly.
The bare executor bypassed the Eventlet detection that factory exists for,
reintroducing the known Python 3.7+/Eventlet hang for users configured
with EventletConnection. GreenThreadPoolExecutor (futurist) subclasses
concurrent.futures._base.Executor, so it supports the same `with ... as
executor:` context-manager protocol, no restructuring needed.
- tests/unit/test_control_connection.py: MockConnection.wait_for_response
now honors the fail_on_error=False contract, returning (True, result)
instead of a bare result, matching cassandra/connection.py's
Connection.fetch_all_pages/wait_for_response behavior. Added a regression
test covering this. Also added MockCluster._create_thread_pool_executor
so tests exercising the fixed call sites keep working.
- Renamed a loop variable that shadowed the `call` import from
unittest.mock (Ruff F402) in test_topology_queries_use_paging.1 parent 6bdf2fb commit 67778d8
2 files changed
Lines changed: 22 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3935 | 3935 | | |
3936 | 3936 | | |
3937 | 3937 | | |
3938 | | - | |
| 3938 | + | |
3939 | 3939 | | |
3940 | 3940 | | |
3941 | 3941 | | |
| |||
4103 | 4103 | | |
4104 | 4104 | | |
4105 | 4105 | | |
4106 | | - | |
| 4106 | + | |
4107 | 4107 | | |
4108 | 4108 | | |
4109 | 4109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
124 | 127 | | |
125 | 128 | | |
126 | 129 | | |
| |||
177 | 180 | | |
178 | 181 | | |
179 | 182 | | |
180 | | - | |
| 183 | + | |
181 | 184 | | |
182 | 185 | | |
183 | 186 | | |
| |||
331 | 334 | | |
332 | 335 | | |
333 | 336 | | |
334 | | - | |
335 | | - | |
| 337 | + | |
| 338 | + | |
336 | 339 | | |
337 | 340 | | |
338 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
339 | 356 | | |
340 | 357 | | |
341 | 358 | | |
| |||
0 commit comments