Skip to content

[fix](regression) Wait for show config output before parsing#65486

Draft
shuke987 wants to merge 1 commit into
apache:masterfrom
shuke987:codex/fix-mow-show-config-output-wait
Draft

[fix](regression) Wait for show config output before parsing#65486
shuke987 wants to merge 1 commit into
apache:masterfrom
shuke987:codex/fix-mow-show-config-output-wait

Conversation

@shuke987

@shuke987 shuke987 commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: N/A

Related PR: N/A

Problem Summary:

test_mow_table_with_format_v2 used consumeProcessOutput to start asynchronous stdout and stderr reader threads, then called Process.waitFor() and immediately parsed the stdout buffer. waitFor() only waits for the curl process and does not join the reader threads, so the case could intermittently parse an empty buffer even though /api/show_config returned a complete response.

The same failure signature appeared in P0 build 992109 and Cloud P0 build 983996: curl exited with code 0 and reported receiving the response, while the captured stdout was still empty at parse time.

This change uses waitForProcessOutput to wait for both reader threads before reading the exit value and parsing the JSON response. The product assertions and test intent are unchanged.

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
      • Parsed the modified case with the repository's Groovy 4.0.19 runtime.
      • Verified waitForProcessOutput captures a 51,904-byte stdout payload before returning.
      • git diff --check passed.
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary: The regression case started asynchronous stdout and stderr consumers for the show-config curl process, but only waited for the process itself before parsing stdout. The stdout consumer could still be copying the response, causing intermittent empty JSON input. Wait for both output consumers to finish before reading the exit value and parsing the response.

### Release note

None

### Check List (For Author)

- Test: Manual test
    - Parsed the changed case with Groovy 4.0.19 and verified a 51,904-byte process stdout payload is fully captured.
- Behavior changed: No
- Does this need documentation: No
@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?

@shuke987

Copy link
Copy Markdown
Collaborator Author

run buildall

@shuke987

Copy link
Copy Markdown
Collaborator Author

/review

@github-actions github-actions Bot 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.

Reviewed PR 65486 against the Doris code-review checkpoints. I did not find a substantiated issue that warrants an inline review comment.

Key conclusions:

  • Goal and scope: The PR targets an intermittent regression-test race where consumeProcessOutput reader threads could still be filling stdout after Process.waitFor() returned. Replacing it with waitForProcessOutput before parsing directly addresses that in the changed test.
  • Focus and size: The patch is small and limited to the /api/show_config capture path in test_mow_table_with_format_v2.
  • Concurrency/lifecycle: No Doris runtime concurrency or lifecycle code is changed. The relevant concurrency is local process-output reader thread synchronization, and the new pattern waits for the output consumers before reading exitValue() and parsing.
  • Compatibility/config/session: No product config, session propagation, FE/BE protocol, persisted data, or storage format changes.
  • Optimizer/data correctness: SQL text, expected product assertions, MATCH query shape, and compaction checks are unchanged.
  • Tests and validation: I could not run the regression suite in this checkout because .worktree_initialized and thirdparty/installed are absent and groovy is not installed. Static review used GitHub PR metadata and local source inspection. Existing Doris regression tests use the same waitForProcessOutput(...); exitValue() pattern.
  • User focus: No additional user-provided focus was supplied.

Subagent conclusions:

  • optimizer-rewrite: no optimizer/rewrite candidate; the patch does not affect SQL text, plan shape, joins, aggregates, or Nereids rules.
  • tests-session-config: no tests/session/config candidate; expected outputs and config/session propagation are unchanged.
  • Convergence: round 1 ended with all live subagents reporting NO_NEW_VALUABLE_FINDINGS for the final ledger and empty inline-comment set.

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.

2 participants