-
-
Notifications
You must be signed in to change notification settings - Fork 132
Retry transient upstream failures in PluginHTTPClient #1284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -418,7 +418,8 @@ final class GladiaPlugin: NSObject, TranscriptionEnginePlugin, LanguageHintTrans | |
| for _ in 0..<300 { | ||
| try await Task.sleep(for: .seconds(1)) | ||
|
|
||
| let (data, response) = try await PluginHTTPClient.data(for: request) | ||
| // The 300-iteration loop is already the retry. | ||
| let (data, response) = try await PluginHTTPClient.data(for: request, retry: .disabled) | ||
|
Comment on lines
+421
to
+422
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Continue polling after transient transport errors.
🤖 Prompt for AI Agents |
||
| guard let httpResponse = response as? HTTPURLResponse, httpResponse.statusCode == 200 else { | ||
| continue | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -329,7 +329,9 @@ final class SpeechmaticsPlugin: NSObject, TranscriptionEnginePlugin, DictionaryT | |
| for _ in 0..<300 { | ||
| try await Task.sleep(for: .seconds(1)) | ||
|
|
||
| let (data, response) = try await PluginHTTPClient.data(for: statusRequest) | ||
| // This loop already re-issues on any non-200, up to 300 times. A ladder here | ||
| // would multiply the loop's own bound rather than add resilience. | ||
| let (data, response) = try await PluginHTTPClient.data(for: statusRequest, retry: .disabled) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Keep transient transport retries in
🤖 Prompt for AI Agents |
||
|
|
||
| guard let httpResponse = response as? HTTPURLResponse, httpResponse.statusCode == 200 else { | ||
| continue | ||
|
|
||
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Catch non-stale transient transport errors in the polling loop.
.disabledonly retries stale pooled-connection errors. Other transient errors, such as timeouts or connection loss, escapePluginHTTPClient.dataand abortpollTranscriptionbefore the next iteration. Catch transient transport errors at this boundary and continue polling. Rethrow cancellation and non-transient errors.🤖 Prompt for AI Agents