Skip to content

Commit

Permalink
fix: revert insufficient capacity error name change
Browse files Browse the repository at this point in the history
This commit reverts the error changes since this will break backward
compatibility with old orchestrators.
  • Loading branch information
rickstaa committed Feb 12, 2025
1 parent 4c7f77d commit 8812662
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions server/ai_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (h *lphttp) StartLiveVideoToVideo() http.Handler {

// Check if there is capacity for the request
if !orch.CheckAICapacity(pipeline, modelID) {
respondWithError(w, fmt.Sprintf("insufficient capacity for pipeline=%v modelID=%v", pipeline, modelID), http.StatusServiceUnavailable)
respondWithError(w, fmt.Sprintf("Insufficient capacity for pipeline=%v modelID=%v", pipeline, modelID), http.StatusServiceUnavailable)
return
}

Expand Down Expand Up @@ -480,7 +480,7 @@ func handleAIRequest(ctx context.Context, w http.ResponseWriter, r *http.Request

// Check if there is capacity for the request.
if !orch.CheckAICapacity(pipeline, modelID) {
respondWithError(w, fmt.Sprintf("insufficient capacity for pipeline=%v modelID=%v", pipeline, modelID), http.StatusServiceUnavailable)
respondWithError(w, fmt.Sprintf("Insufficient capacity for pipeline=%v modelID=%v", pipeline, modelID), http.StatusServiceUnavailable)
return
}

Expand Down
6 changes: 3 additions & 3 deletions server/ai_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -1356,10 +1356,10 @@ func processImageToText(ctx context.Context, params aiRequestParams, req worker.
return txtResp, nil
}

// isRetryableError checks if the error is a transient error that can be retried.
func isRetryableError(err error) bool {
// isTransientError checks if the error is a transient error that can be retried.
func isTransientError(err error) bool {
transientErrorMessages := []string{
"insufficient capacity", // Caused by limitation in our current implementation.
"Insufficient capacity", // Caused by limitation in our current implementation.
"invalid ticket senderNonce", // Caused by gateway nonce mismatch.
"TicketParams expired", // Caused by ticket expiration.
}
Expand Down

0 comments on commit 8812662

Please sign in to comment.