Skip to content

Conversation

@vinodkc
Copy link
Contributor

@vinodkc vinodkc commented Nov 28, 2025

What changes were proposed in this pull request?

Added explicit stdout/stderr redirection to Redirect.DISCARD for the child Spark Connect server process in non-debug mode in SparkConnectServerUtils.

Why are the changes needed?

SparkConnectJdbcDataTypeSuite randomly hangs because the child server process blocks on write() calls when stdout/stderr pipe buffers fill up. Without consuming the output, the buffers reach capacity and cause the process to block indefinitely.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Manually tested verified SparkConnectJdbcDataTypeSuite no longer randomly hangs and all tests pass consistently.

Was this patch authored or co-authored using generative AI tooling?

No

@vinodkc
Copy link
Contributor Author

vinodkc commented Nov 28, 2025

CC @pan3793 , @dongjoon-hyun @cloud-fan

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-54551][CONNECT] Fix random hangs in SparkConnectJdbcDataTypeSuite [SPARK-54551][CONNECT][TESTS] Fix random hangs in SparkConnectJdbcDataTypeSuite Nov 29, 2025
Copy link
Member

@pan3793 pan3793 left a comment

Choose a reason for hiding this comment

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

The change makes sense to me

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM for this test change. Thank you, @vinodkc , @cloud-fan , @pan3793 .
Merged to master/4.1 for Apache Spark 4.1.0.

dongjoon-hyun pushed a commit that referenced this pull request Nov 29, 2025
…aTypeSuite

### What changes were proposed in this pull request?

Added explicit stdout/stderr redirection to Redirect.DISCARD for the child Spark Connect server process in non-debug mode in SparkConnectServerUtils.

### Why are the changes needed?

SparkConnectJdbcDataTypeSuite randomly hangs because the child server process blocks on write() calls when stdout/stderr pipe buffers fill up. Without consuming the output, the buffers reach capacity and cause the process to block indefinitely.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Manually tested verified `SparkConnectJdbcDataTypeSuite` no longer randomly hangs and all tests pass consistently.

### Was this patch authored or co-authored using generative AI tooling?

No

Closes #53261 from vinodkc/br_handle_std_pipe.

Authored-by: vinodkc <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit 99270f0)
Signed-off-by: Dongjoon Hyun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants