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
{{ message }}
Repository navigation
A timed-out request is sent three more times at the full timeout, up to eight minutes before an error #438
Split out of #437, from the same email: after a WhatsApp call, the reporter's spinner had been
running for about 700 s.
The arithmetic
executeForBody(maxRetries = 3) retries every kind for which isRetryable is true (TIMEOUT, NETWORK, SERVER_ERROR and UNKNOWN), with RETRY_DELAY_MS = 3000 between attempts. For a
dictation, the per-operation and the whole-call timeout are both the user's Request timeout
(default 120 s). So a connection that stalls costs this much, whether the network changed under an
upload or the phone went into a call:
4 × 120 s + 3 × 3 s = 489 s ≈ 8 minutes
With the timeout raised to 180 s, it is about 12 minutes. Soniox and AssemblyAI poll on their own
5-minute budget on top of that.
A retry earns its keep after an error that came fast: a refused connection, a reset, a 502. That is
what the retries are for, and each one costs seconds. A full-length timeout is a different thing. The
budget the user chose is already spent, and repeating it three times multiplies the wait they asked
for by four. #363 is the same pattern on the watch.
Being offline is not the problem. DNS fails at once there, and the error arrives after about 9 s. The
problem is a connection that stalls.
What to change
Make a timeout that used the whole budget terminal, and let fast transport errors keep their
three retries. That needs executeForBody to tell "timed out" apart from "failed quickly". The
attempt's elapsed time is already measured (startedNanos). After the error, the resend chip is
the retry, and the user decides whether to wait another round.
Worth checking: when the active network drops or changes during a request
(ConnectivityManager.NetworkCallback), cancel the stalled call and retry once on the new network
straight away instead of waiting out the read timeout. If it was the call that moved the
connection, that is what would have helped in the reported case.
Split out of #437, from the same email: after a WhatsApp call, the reporter's spinner had been
running for about 700 s.
The arithmetic
executeForBody(maxRetries = 3)retries every kind for whichisRetryableis true (TIMEOUT,NETWORK,SERVER_ERRORandUNKNOWN), withRETRY_DELAY_MS = 3000between attempts. For adictation, the per-operation and the whole-call timeout are both the user's Request timeout
(default 120 s). So a connection that stalls costs this much, whether the network changed under an
upload or the phone went into a call:
With the timeout raised to 180 s, it is about 12 minutes. Soniox and AssemblyAI poll on their own
5-minute budget on top of that.
A retry earns its keep after an error that came fast: a refused connection, a reset, a 502. That is
what the retries are for, and each one costs seconds. A full-length timeout is a different thing. The
budget the user chose is already spent, and repeating it three times multiplies the wait they asked
for by four. #363 is the same pattern on the watch.
Being offline is not the problem. DNS fails at once there, and the error arrives after about 9 s. The
problem is a connection that stalls.
What to change
three retries. That needs
executeForBodyto tell "timed out" apart from "failed quickly". Theattempt's elapsed time is already measured (
startedNanos). After the error, the resend chip isthe retry, and the user decides whether to wait another round.
(
ConnectivityManager.NetworkCallback), cancel the stalled call and retry once on the new networkstraight away instead of waiting out the read timeout. If it was the call that moved the
connection, that is what would have helped in the reported case.
other calls that use Request timeout.
Related
#354/#355 (real timeout, elapsed seconds), #337 (the app's timeout map), #363 (the watch's version of
this).