You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fluss.apache.org by "raoluSmile (via GitHub)" <gi...@apache.org> on 2026/06/10 11:22:23 UTC
[PR] [client] Propagate write batch failures to flush [fluss]
raoluSmile opened a new pull request, #3468:
URL: https://github.com/apache/fluss/pull/3468
### Purpose
When `WriterClient.flush()` waits for pending write batches, it relies on
`RecordAccumulator.awaitFlushCompletion()`, which waits on each
`WriteBatch.RequestFuture`.
Before this change, a write batch could be completed exceptionally through
`WriteBatch.completeExceptionally(exception)`, but `RequestFuture` only counted
down its latch and did not keep or rethrow the exception. As a result,
`flush()` could wait silently without surfacing the underlying write failure,
and in retry/error paths this could look like a hang to the caller.
I hit this when TabletServer rejected writes with `DISK_WRITE_LOCKED`.
The writer kept retrying until request timeout, but the failure was not
propagated through the flush waiting path, so the test appeared to hang instead
of failing with the real write error.
This issue is independent of `DISK_WRITE_LOCKED` itself. Any write batch that
is completed exceptionally should be observable by callers waiting in `flush()`.
This is related to, but different from, #1258. #1258 fixed a lost `WriteBatch`
case where `awaitFlushCompletion()` could wait forever. This PR fixes another
failure path: a `WriteBatch` is completed exceptionally, but the corresponding
`RequestFuture.await()` did not propagate the batch exception.
### Brief change log
- Store the batch exception in `WriteBatch.RequestFuture` when a batch completes.
- Rethrow the stored exception from `RequestFuture.await()`.
- Let `RecordAccumulator.awaitFlushCompletion()` propagate batch failures.
- Wrap propagated flush failures in `WriterClient.flush()`.
- Stop retrying retriable write errors after the request timeout has elapsed.
- Add a unit test to verify that `awaitFlushCompletion()` observes batch failures.
### Tests
- `./mvnw -pl fluss-client -DfailIfNoTests=false -Dtest=RecordAccumulatorTest#testAwaitFlushCompletionPropagatesBatchFailure test`
- `./mvnw -pl fluss-client -am -DskipTests compile`
### API and Format
No public API or storage format changes.
### Documentation
No documentation changes are required.
--
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: issues-unsubscribe@fluss.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [client] Propagate write batch failures to flush [fluss]
Posted by "github-actions[bot] (via GitHub) via issues" <is...@fluss.apache.org>.
github-actions[bot] commented on PR #3468:
URL: https://github.com/apache/fluss/pull/3468#issuecomment-6719348125
This PR has been marked as stale because it has had no activity for 60 days. It will be closed in 10 days unless it receives a new comment, commit or other update.
--
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: issues-unsubscribe@fluss.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [client] Propagate write batch failures to flush [fluss]
Posted by "github-actions[bot] (via GitHub) via issues" <is...@fluss.apache.org>.
github-actions[bot] commented on PR #3468:
URL: https://github.com/apache/fluss/pull/3468#issuecomment-6973407365
This PR was closed because it has been stale for 10 days with no activity.
--
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: issues-unsubscribe@fluss.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [client] Propagate write batch failures to flush [fluss]
Posted by "github-actions[bot] (via GitHub) via issues" <is...@fluss.apache.org>.
github-actions[bot] closed pull request #3468: [client] Propagate write batch failures to flush
URL: https://github.com/apache/fluss/pull/3468
--
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: issues-unsubscribe@fluss.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [client] Propagate write batch failures to flush [fluss]
Posted by "Jackeyzhe (via GitHub)" <gi...@apache.org>.
Jackeyzhe commented on code in PR #3468:
URL: https://github.com/apache/fluss/pull/3468#discussion_r3935798979
##########
fluss-client/src/main/java/org/apache/fluss/client/write/RecordAccumulator.java:
##########
Review Comment:
If one request future fails, this loop exits immediately and leaves the remaining futures captured by the same flush potentially incomplete. That breaks the documented flush post-condition and can let writer close proceed while another drained/in-flight batch is still pending. Please retain the first failure, wait for every captured future, and propagate the failure afterward; a two-batch regression test would cover this case.
--
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: issues-unsubscribe@fluss.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [client] Propagate write batch failures to flush [fluss]
Posted by "Jackeyzhe (via GitHub)" <gi...@apache.org>.
Jackeyzhe commented on code in PR #3468:
URL: https://github.com/apache/fluss/pull/3468#discussion_r3935839041
##########
fluss-client/src/main/java/org/apache/fluss/client/write/Sender.java:
##########
@@ -321,6 +321,7 @@ private boolean canRetry(ReadyWriteBatch readyWriteBatch, Errors error) {
WriteBatch batch = readyWriteBatch.writeBatch();
return batch.attempts() < retries
&& !batch.isDone()
+ && batch.waitedTimeMs(System.currentTimeMillis()) < maxRequestTimeoutMs
Review Comment:
waitedTimeMs is measured from batch creation and includes batching, metadata lookup, throttling, and queueing, while client.request-timeout is documented as the timeout for one request. This can disable retries for an old queued batch even when its current request fails immediately and client.writer.retries still allows retries. Please model this as a dedicated delivery timeout, or keep this separate retry-policy change out of this PR, and add coverage for the expiration path.
--
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: issues-unsubscribe@fluss.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org