Skip to content

[SPARK-59407][UI][3.5] Improve compressed line handling in Spark History server - #59058

Closed
holdenk wants to merge 3 commits into
apache:branch-3.5from
holdenk:f040-compressed-file-handling-branch-3.5
Closed

holdenk wants to merge 3 commits into
apache:branch-3.5from
holdenk:f040-compressed-file-handling-branch-3.5

Conversation

@holdenk

@holdenk holdenk commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Backport of SPARK-59407 to branch-3.5, based on master commit 38258cb (#58700).

Skip excessively long event log lines during History Server replay: ReplayListenerBus reads lines with a per-line byte cap (spark.history.fs.eventLog.maxLineLength, default 512m) instead of materializing unbounded lines; over-long lines are drained and skipped with a warning.

Branch adaptations vs master: the config declares .version("3.5.10") and drops .withBindingPolicy(...) (ConfigBindingPolicy exists only on 4.2+); the new warning uses plain string interpolation since branch-3.5 predates the structured logging framework.

Why are the changes needed?

Individual corrupt or unexpectedly large event log lines can make loading a previous Spark job in the History Server slow or exhaust memory; bounding the per-line length keeps replay memory bounded.

Does this PR introduce any user-facing change?

Yes: new configuration spark.history.fs.eventLog.maxLineLength (default 512m). Event log lines longer than the cap are skipped with a warning instead of being read into memory during replay; setting it to 0 or a negative value disables the limit.

How was this patch tested?

New test in ReplayListenerSuite covering that an over-long line is skipped while neighboring events still replay. Full core module test suite run locally on this branch, green.

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

Generated-by: Claude and Cursor

Made with Cursor

sfc-gh-hkarau and others added 3 commits September 5, 2026 01:14
Replay materializes each event log line as a String with no length bound,
so a corrupt or unexpectedly large log can exhaust the memory of the
process replaying it. Cap lines at spark.history.fs.eventLog.maxLineLength
(default 512m, <= 0 disables): longer lines are drained and skipped with a
warning while the remaining events still replay.

Co-authored-by: Cursor <cursoragent@cursor.com>
A single version does not tell an operator which maintenance releases carry a
backported config, so name the set. Declare the version this branch first ships
in, and add the row to the monitoring table -- until now the note only reached
the config doc, where nobody reading the docs sees it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

Co-Authored-By: Holden Karau <holden@pigscanfly.ca>
asf-gitbox-commits pushed a commit that referenced this pull request Sep 25, 2026
…ory server

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

Backport of SPARK-59407 to branch-3.5, based on master commit 38258cb (#58700).

Skip excessively long event log lines during History Server replay: `ReplayListenerBus` reads lines with a per-line byte cap (`spark.history.fs.eventLog.maxLineLength`, default 512m) instead of materializing unbounded lines; over-long lines are drained and skipped with a warning.

Branch adaptations vs master: the config declares `.version("3.5.10")` and drops `.withBindingPolicy(...)` (ConfigBindingPolicy exists only on 4.2+); the new warning uses plain string interpolation since branch-3.5 predates the structured logging framework.

### Why are the changes needed?

Individual corrupt or unexpectedly large event log lines can make loading a previous Spark job in the History Server slow or exhaust memory; bounding the per-line length keeps replay memory bounded.

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

Yes: new configuration `spark.history.fs.eventLog.maxLineLength` (default 512m). Event log lines longer than the cap are skipped with a warning instead of being read into memory during replay; setting it to 0 or a negative value disables the limit.

### How was this patch tested?

New test in `ReplayListenerSuite` covering that an over-long line is skipped while neighboring events still replay. Full core module test suite run locally on this branch, green.

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

Generated-by: Claude and Cursor

Made with [Cursor](https://cursor.com)

Closes #59058 from holdenk/f040-compressed-file-handling-branch-3.5.

Lead-authored-by: Holden Karau <holden@pigscanfly.ca>
Co-authored-by: Holden Karau <holden.karau@snowflake.com>
Signed-off-by: Holden Karau <holden.karau@snowflake.com>
@holdenk

holdenk commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

Merged to 3.5

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