mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 06:38:13 -05:00
Send one batched request per event batch instead of one request per event. Application Insights v2/track accepts an array of envelopes, so a batch of up to maxBatchSize (512) events was previously issued as 512 concurrent POSTs. QNetworkAccessManager only opens a handful of connections per host, so the queued requests were aborted by their own transfer timeout before reaching the wire, reported as "HTTP 0: Operation canceled". Honour the circuit breaker in processEvents(). It was only checked when enqueuing, so the up to 10000 already queued events kept being posted at full rate after the breaker opened. The crash and shutdown flush bypasses the breaker so a crash report is still attempted. Keep at most one request in flight. Failures are only observed when the reply finishes, which for an unreachable endpoint takes the full transfer timeout, and the 100 ms timer kept launching requests during that window. Log the circuit breaker transition once instead of on every subsequent failure. Only read the reply body when the device is open. An aborted reply has a closed device, and reading from it emitted a QIODevice warning per request. Call attemptReconnection() from the process timer. It was dead code, so once the breaker opened it could only close if a reply happened to succeed.