perf(notifications,ecm): pool outbound httpx clients + lifecycle close (v26.06.70)#97
Merged
Conversation
added 3 commits
June 7, 2026 21:09
…e + bump v26.06.70
The audit found 7 provider adapters built a NEW httpx.AsyncClient per call (no pooling):
notifications/providers/{sendgrid,resend,twilio,firebase} + ecm/adapters/{docusign,adobe_sign,logalty}.
Now each keeps one lazily-created pooled client and closes it on stop() (added start/stop lifecycle
so the ApplicationContext closes it). New pyfly.client.pooled.PooledHttpClient async-CM wrapper yields
the shared client without closing on __aexit__, so the existing 'async with await self._client()' call
sites (1 in each notifier, 3 each in the ECM adapters) are unchanged.
Tests: tests/client/test_pooled_http_client.py (3 — wrapper no-close, email + ecm pool-and-close).
Gates: mypy --strict (637), ruff + format, full suite 3941 passed.
…ip on startup failure CI 3.12 had a Docker daemon but couldn't pull images (registry timeout), so @requires_docker passed but the postgres/redis integration fixtures ERRORED on container start instead of skipping. Moved the redis_url/pg_url fixtures into tests/integration/conftest.py with a try/except that pytest.skips on ANY container-startup failure (image pull, daemon issues) — so the suite degrades to skipped, not errored, wherever Docker isn't fully functional. Removed the now-duplicate local fixtures + unused imports.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Audit efficiency fix: 7 outbound provider adapters (notifications SendGrid/Resend/Twilio/Firebase, ECM DocuSign/Adobe Sign/Logalty) built a new
httpx.AsyncClientper call — no connection reuse. Now each keeps one lazily-created pooled client, reused across calls, and closes it on shutdown via addedstart()/stop()lifecycle (theApplicationContextcalls them).A shared
PooledHttpClientasync-context wrapper yields the shared client without closing it on__aexit__, so the existingasync with await self._client()call sites (1 per notifier, 3 per ECM adapter) stay unchanged — minimal diff, same behavior, pooled connections. Tests (3). Gates: mypy --strict (637), ruff+format, full suite 3941.