Skip to content

fix(pool): synchronize teardown lease releases#1193

Merged
axisrow merged 1 commit into
mainfrom
ao/tg_content_factory_5863f66be3-4/fix-1191-client-pool-teardown-locks
Jun 28, 2026
Merged

fix(pool): synchronize teardown lease releases#1193
axisrow merged 1 commit into
mainfrom
ao/tg_content_factory_5863f66be3-4/fix-1191-client-pool-teardown-locks

Conversation

@axisrow

@axisrow axisrow commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Route remove_client teardown cleanup through _lease_pool.release(phone) while holding ClientPool._lock.
  • Route disconnect_all timeout force-cleanup through _lease_pool.release(phone) while holding ClientPool._lock.
  • Route _acquire_from_lease non-shared failure cleanup through _lease_pool.release(phone) while holding ClientPool._lock.
  • Add regression tests that spy on _lease_pool.release and assert ClientPool._lock is held at the release/discard point.

Validation

  • pytest tests/test_client_pool_lifecycle.py -v passed.
  • Mutation check: temporarily restored the old teardown/release behavior; the three new fix(pool): bare _in_use.discard вне AccountLeasePool._lock в remove_client/disconnect_all (тот же класс что #1181, teardown-пути) #1191 regression tests failed, then passed again after restoring the fix.
  • pytest tests/test_main_client_pool_collector_paths.py::TestClientPoolProperties::test_remove_client -v passed.
  • ruff check src/ tests/ conftest.py passed.
  • pytest tests/ -v -m aiosqlite_serial passed: 941 passed, 9242 deselected.
  • pytest tests/ -v -m "not aiosqlite_serial" -n auto was run after the main fix. It exposed one local test-double update, now fixed and verified, plus unrelated provider/env failures in tests/test_quality_scoring_service.py and tests/test_pipelines.py caused by live/default provider behavior and unclosed socket warnings in this environment.

Closes #1191

@axisrow axisrow marked this pull request as ready for review June 28, 2026 17:49
@axisrow axisrow merged commit 88c2c94 into main Jun 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(pool): bare _in_use.discard вне AccountLeasePool._lock в remove_client/disconnect_all (тот же класс что #1181, teardown-пути)

1 participant