Skip to content

[client] Clean up batches when synchronous sends fail - #4028

Open
gyang94 wants to merge 1 commit into
apache:mainfrom
gyang94:codex/fix-sender-sync-send-failure
Open

[client] Clean up batches when synchronous sends fail#4028
gyang94 wants to merge 1 commit into
apache:mainfrom
gyang94:codex/fix-sender-sync-send-failure

Conversation

@gyang94

@gyang94 gyang94 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Clean up drained write batches when request construction or gateway submission throws before returning a future.
  • Scope failure handling to batches from the affected table request.
  • Add regression coverage for direct-memory OOM during synchronous KV sends.

Root cause

Sender registers drained batches as in-flight before invoking the tablet-server gateway. If RPC request construction or encoding throws synchronously, no response future or completion callback is installed. The affected batches therefore remain incomplete, retain writer-buffer pages indefinitely, and can eventually block the writer after the buffer is exhausted.

Test Plan

  • Ran SenderTest: 22 tests passed.
  • Checkstyle, Spotless, and RAT checks passed for the affected reactor build.
  • Verified the staged diff with git diff --cached --check.

Fixes #4018

🤖 AI-assisted changes - reviewed by human developer

@gyang94
gyang94 marked this pull request as ready for review August 18, 2026 07:31
Handle failures thrown before an RPC future is returned so drained
batches do not remain permanently in-flight or retain writer-buffer
pages.

Co-Authored-By: Codex <noreply@openai.com>
AI-Model: gpt-5
AI-Contributed/Feature: 51/51
AI-Contributed/UT: 37/37
@gyang94
gyang94 force-pushed the codex/fix-sender-sync-send-failure branch from 561c5e4 to 78f7477 Compare August 19, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Writer batches can hang forever after synchronous RPC encoding failure

1 participant