Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-50909][PYTHON][4.0] Setup faulthandler in PythonPlannerRunners #49635

Open
wants to merge 2 commits into
base: branch-4.0
Choose a base branch
from

Conversation

ueshin
Copy link
Member

@ueshin ueshin commented Jan 24, 2025

What changes were proposed in this pull request?

This is a backport of #49592.

Setups faulthandler in PythonPlannerRunners.

It can be enabled by the same config as UDFs.

  • SQL conf: spark.sql.execution.pyspark.udf.faulthandler.enabled
  • It fallback to Spark conf: spark.python.worker.faulthandler.enabled
  • False by default

Why are the changes needed?

The faulthandler is not set up in PythonPlannerRunners.

Does this PR introduce any user-facing change?

When enabled, if Python worker crashes, it may generate thread-dump in the error message on the best-effort basis of Python process.

How was this patch tested?

Added the related tests.

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

No.

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

Setups `faulthandler` in `PythonPlannerRunner`s.

It can be enabled by the same config as UDFs.

- SQL conf: `spark.sql.execution.pyspark.udf.faulthandler.enabled`
- It fallback to Spark conf: `spark.python.worker.faulthandler.enabled`
- `False` by default

### Why are the changes needed?

The `faulthandler` is not set up in `PythonPlannerRunner`s.

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

When enabled, if Python worker crashes, it may generate thread-dump in the error message on the best-effort basis of Python process.

### How was this patch tested?

Added the related tests.

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

No.

Closes apache#49592 from ueshin/issues/SPARK-50909/faulthandler.

Authored-by: Takuya Ueshin <[email protected]>
Signed-off-by: Takuya Ueshin <[email protected]>
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.

Since one of the failures is Python part, could you re-trigger once more, @ueshin ?

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.

3 participants