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
v0.5.5: fix event-loop starvation under load; +115 lines coverage
Converted 14 FastAPI endpoints from `async def` to plain `def` so
FastAPI runs them in a threadpool. A single slow yfinance call was
freezing uvicorn's event loop, queuing every concurrent request —
including the HTML page — and causing 30s page.goto timeouts under
parallel test load. Same freeze would hit real users during Yahoo
rate-limit events. `upload_transactions` stays async (needs
`await file.read()`); `startup_event` stays async (FastAPI requirement).
Also: main.py coverage 72% → 89% via 13 new targeted unit tests
(upload pipeline, exchange-rate fallback, update-market-data ticker
resolver and Yahoo fallback, refresh-live-prices error branches,
purge/shutdown error paths, ensure_indices_exist rollback). Playwright
`page.goto` switched to `wait_until="domcontentloaded"`. Suite now
passes 5/5 consecutive parallel runs (224 tests).
FastAPI app.version bumped from stale "0.4.0" to track pyproject.toml.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [0.5.5] - 2026-04-14
9
+
10
+
### Fixed
11
+
-**Event-loop starvation under load (production bug)**: 14 FastAPI endpoints were declared `async def` while doing sync blocking I/O (yfinance HTTP calls, SQLAlchemy queries). A single slow upstream call froze uvicorn's event loop, queuing every concurrent request — including the HTML page — until it completed. Converted all non-awaiting endpoints to plain `def` so FastAPI runs them in a threadpool. Eliminates 30s `page.goto` timeouts seen under parallel test load and prevents the same freeze under real user load with slow upstream APIs.
12
+
-**FastAPI `app.version`**: was stuck at `"0.4.0"`, now tracks `pyproject.toml` version.
13
+
14
+
### Testing
15
+
-**Coverage for `main.py`: 72% → 89%** (+115 lines). Added 13 targeted unit tests covering upload pipeline (new-stock insert, duplicate skip, held-stock filtering, FMP live-price branch, index update exceptions), exchange-rate Yahoo fallback paths, `update-market-data` ticker auto-resolve and Yahoo fallback, `refresh-live-prices` error branches, purge/shutdown error paths, and `ensure_indices_exist` rollback.
16
+
-**Playwright fixture flakiness eliminated**: switched `page.goto` to `wait_until="domcontentloaded"` in shared_page, CSV, and Dutch e2e fixtures. Combined with the event-loop fix, the full suite now passes 5/5 consecutive parallel runs (was 2–3/5 before).
17
+
-**224 tests total**, stable across 5 consecutive parallel runs.
0 commit comments