Problem
flush() now sends events individually (one POST per event) to match the server's flat db.Event struct. With batch_size=10 and the default httpx 10s timeout, a single flush could block for up to ~100s in the worst case if the registry is slow or unreachable.
The old batch approach had the same 10s timeout but for a single request. In practice the registry responds in <100ms so this isn't a production issue today, but it's a latent risk.
Proposed improvements
- Per-event timeout — reduce from inherited 10s to ~2s for event ingestion POSTs
- Concurrent sends — use a thread pool or
asyncio.gather to send events in parallel rather than sequentially
- Overall deadline — cap total flush duration regardless of event count (e.g., 5s total)
Context
From reviewer comment on PR #63: #63 (comment)
Problem
flush()now sends events individually (one POST per event) to match the server's flatdb.Eventstruct. Withbatch_size=10and the default httpx 10s timeout, a single flush could block for up to ~100s in the worst case if the registry is slow or unreachable.The old batch approach had the same 10s timeout but for a single request. In practice the registry responds in <100ms so this isn't a production issue today, but it's a latent risk.
Proposed improvements
asyncio.gatherto send events in parallel rather than sequentiallyContext
From reviewer comment on PR #63: #63 (comment)