Skip to content

branch-4.1: [fix](load)fix VNodeChannel close_wait hang#65241

Open
liaoxin01 wants to merge 1 commit into
apache:branch-4.1from
liaoxin01:codex/pick-58024-to-branch-4.1
Open

branch-4.1: [fix](load)fix VNodeChannel close_wait hang#65241
liaoxin01 wants to merge 1 commit into
apache:branch-4.1from
liaoxin01:codex/pick-58024-to-branch-4.1

Conversation

@liaoxin01

Copy link
Copy Markdown
Contributor

Pick #58024

During streamload execution, close_wait waits for either
add_batches_finished or cancel. When writing to a single replica,
encountering a slave node=nullptr condition causes an early return. If
no RPC callback is set and no cancel occurs at this point, close_wait
becomes deadlock.
Copilot AI review requested due to automatic review settings July 6, 2026 06:35
@liaoxin01 liaoxin01 requested a review from yiguolei as a code owner July 6, 2026 06:35
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR backports a fix to prevent stream load from hanging in close_wait() when VNodeChannel::try_send_pending_block() hits certain early-return error paths (e.g., missing slave node or DNS resolve failure), and adds a regression test to catch the hang.

Changes:

  • Add a regression test that enables a BE debug point to simulate “slave node not found” and ensures the load does not hang.
  • In VNodeChannel::try_send_pending_block(), call cancel() and _send_block_callback->clear_in_flight() before returning when a slave node is missing.
  • Also cancel() (and clear in-flight) when hostname-to-IP resolution fails for the BRPC HTTP path.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
regression-test/suites/load_p0/test_stream_load_close_wait_hang.groovy New regression to detect stream-load close_wait() hang under a debug-injected error path.
be/src/exec/sink/writer/vtablet_writer.cpp Fixes early-return paths to cancel and clear in-flight RPC state to avoid hangs; adds a debug point for reproduction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread be/src/exec/sink/writer/vtablet_writer.cpp
Comment thread be/src/exec/sink/writer/vtablet_writer.cpp
@liaoxin01

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/10) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 54.78% (20953/38250)
Line Coverage 38.21% (199958/523330)
Region Coverage 34.65% (156870/452668)
Branch Coverage 35.63% (68524/192337)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 0.00% (0/10) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 72.05% (26928/37373)
Line Coverage 55.13% (287157/520829)
Region Coverage 52.62% (239821/455763)
Branch Coverage 53.72% (103487/192633)

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.

4 participants