zhang-arvin commented on PR #7022:
URL: https://github.com/apache/shenyu/pull/7022#issuecomment-5841907216
This change is now covered by #7205 ("avoid retrying partial AI streams"),
which is already on master, so this PR is no longer needed.
On master (`AiProxyExecutorService`, commit `41dee74`), a single `emitted`
flag now guards **both** branches:
```java
AtomicBoolean emitted = new AtomicBoolean();
.doOnNext(chunk -> emitted.set(true))
.retryWhen(Retry.max(1).filter(error -> !emitted.get() &&
isRetryable(error)))
.onErrorResume(error -> emitted.get()
? ... // stream already
committed -> propagate
: handleDirectFallbackStream(...)); // nothing emitted yet ->
fallback is safe
```
That covers the scenario tracked in #7021 - an unconditional fallback after
the first emitted chunk producing a mixed `main-partial, fallback-completion`
response - in addition to the retry replay from #6647, and it keeps the retry
semantics.
Happy to close this PR if you agree - flagging it here rather than closing
silently. Thanks @Aias00 for keeping an eye on it.
--
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]