Skip to content

Preserve broadcast resource IDs during concurrent registration - #13320

Merged
zhztheplayer merged 1 commit into
apache:mainfrom
yikf:fix/velox-concurrent-broadcast-resources
Oct 16, 2026
Merged

zhztheplayer merged 1 commit into
apache:mainfrom
yikf:fix/velox-concurrent-broadcast-resources

Conversation

@yikf

@yikf yikf commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

Parallel broadcast plans can register resource IDs for the same SQL execution from different driver threads. The Caffeine cache is thread-safe, but its HashSet values are not, so concurrent additions can lose IDs and leave broadcast hash tables out of execution-end cleanup messages.

Use ConcurrentHashMap.newKeySet() for each execution's resource IDs. Preserve the existing expiration and cleanup flow.

How was this patch tested?

Exists UTs.

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

No.

Copilot AI balanced review requested due to automatic review settings October 15, 2026 08:21
@yikf
yikf force-pushed the fix/velox-concurrent-broadcast-resources branch 2 times, most recently from a72ed0f to 351a9af Compare October 15, 2026 08:22
@yikf

yikf commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

@JkSelf @zhztheplayer could you please take a look, thanks.

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

1 open finding
What changed in this PR

Fixes a concurrency bug in broadcast resource tracking by using a thread-safe Set implementation for per-execution resource IDs, preventing lost IDs during parallel registration.

Changes:

  • Replace java.util.HashSet with ConcurrentHashMap.newKeySet() for executionId -> resourceIds cache values to support concurrent add() operations.
File Description
backends-velox/​src/​main/​scala/​org/​apache/​spark/​rpc/​GlutenDriverEndpoint.scala Switch cached resource-id set to a concurrent set to avoid lost registrations under multi-threaded access

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI balanced review requested due to automatic review settings October 15, 2026 08:37
@github-actions github-actions Bot added the VELOX label Oct 15, 2026

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

0 open findings

1 resolved since last review

🧠 Review effort: Lite

Copilot AI balanced review requested due to automatic review settings October 15, 2026 08:52

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

1 open finding

🧠 Review effort: Lite

@zhztheplayer zhztheplayer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does backends-clickhouse have the same bug given the same code structure?

Copilot AI balanced review requested due to automatic review settings October 15, 2026 10:53
@yikf
yikf force-pushed the fix/velox-concurrent-broadcast-resources branch from c25e022 to 94771f8 Compare October 15, 2026 10:53
@yikf yikf changed the title [VL] Preserve broadcast resource IDs during concurrent registration Preserve broadcast resource IDs during concurrent registration Oct 15, 2026
@yikf

yikf commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

same

Thank you, updated.

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

0 open findings

1 resolved since last review

🧠 Review effort: Lite

@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@yikf
yikf force-pushed the fix/velox-concurrent-broadcast-resources branch from 94771f8 to 1242d99 Compare October 16, 2026 06:20
@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@zhztheplayer
zhztheplayer merged commit 11d1e87 into apache:main Oct 16, 2026
77 checks passed
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