goutamadwant opened a new pull request, #13177: URL: https://github.com/apache/seatunnel/pull/13177
### Purpose of this pull request Fixes #13176. Yes, I am contributing this fix to SeaTunnel. Embedding HTTP adapters discard `Retry-After`, allowing retries to exhaust their attempt budget during a provider's cooldown. This was reproduced on unchanged dev using an HTTP stub: both attempts failed during a one-second cooldown. This patch propagates provider delays through the existing model-invocation runtime for OPENAI, CUSTOM, ZHIPU, QIANFAN embedding calls and DOUBAO text/multimodal calls. It supports non-negative delay-seconds and HTTP-date values and waits for the longer of local backoff and provider delay. Responses close before waiting. Malformed headers retain existing backoff, oversized numeric delays cannot overflow, and interrupted waits preserve the interrupt flag. Raw response bodies and header values are not added to diagnostics. ### Does this PR introduce _any_ user-facing change? Yes, compared with current dev. When retries are enabled, valid provider cooldowns are respected. If a provider delay exceeds a positive `model_retry_max_backoff_ms`, the invocation stops instead of retrying early. For example, `Retry-After: 30` exceeds the default 10,000 ms limit. Raise the limit to at least 30,000 ms to accept that delay, or set it to `0` for no provider-delay cap. With `0`, existing constant local backoff is preserved. Option names, defaults and output schemas remain unchanged. Default single-attempt behavior, SDK-managed Amazon Bedrock retries, LLM chat retries and Qianfan constructor-time OAuth retry behavior are unchanged. English/Chinese documentation and migration notes are included. ### How was this patch tested? - HTTP-stub regression failed before the fix and passed afterward; final regressions cover delay-seconds and HTTP-date cooldowns. - Clean JDK 11 and JDK 17 transform suites: 1,975 tests each, zero failures/errors/skips. JDK 17 scoped verification also passed. - Coverage includes provider wiring, malformed/overflow values, cap enforcement, zero cap, attempt limits, interruption, partial cache hits, failed-result exclusion and retry metrics. - Docker Zeta `TestEmbeddingIT`: 9/9 passed, including all five providers' capped failures, HTTP-date rejection and a successful retry with provider timestamps proving the two-second cooldown. - Scoped 66-module E2E reactor build passed with tests skipped for that build step. Spotless apply/check and whitespace checks passed. Commands, using the appropriate JAVA_HOME: ```shell mvn -B -pl seatunnel-transforms-v2 clean test -Dskip.spotless=true mvn -B -pl seatunnel-transforms-v2 clean verify -DskipIT=true -Dskip.spotless=true mvn -B -Pci -pl :seatunnel-transforms-v2-e2e-part-1 -am -DskipTests -DskipIT=true -Dskip.ui=true -Dskip.spotless=true install RUN_ENGINES=zeta mvn -B -Pci -pl :seatunnel-transforms-v2-e2e-part-1 -DskipUT=true -DskipIT=false -Dit.test=TestEmbeddingIT -Dskip.spotless=true verify mvn -B -pl seatunnel-transforms-v2,:seatunnel-transforms-v2-e2e-part-1 spotless:check ``` Live provider accounts, Flink/Spark execution and the full repository matrix were not tested. Hosted CI remains separate. Request timeout is still per request, not an overall invocation deadline. ### Check list * [ ] New Jar binary packages require License/Notice updates. Not applicable: no new dependencies or binary packages. * [x] Documentation updated in English and Chinese. * [x] `incompatible-changes.md` updated in English and Chinese with migration guidance. * [ ] Connector registration checklist. Not applicable: transform-only fix; existing transform E2E extended, with no connector registration changes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
