jiwen624 opened a new pull request, #56095:
URL: https://github.com/apache/spark/pull/56095
### What changes were proposed in this pull request?
Replace `synchronized` with an explicit `subqueryLock` object in
`waitForSubqueries()` and `prepare()`.
### Why are the changes needed?
`waitForSubqueries()` holds the plan's obj lock (with `synchronized`)
while blocking on subquery futures. A concurrent thread computing a Scala lazy
val on the same plan object (e.g. `FileSourceScanLike.metadata` via AQE's
`onUpdatePlan` → `SparkPlanInfo.fromSparkPlan`) also needs the plan's obj lock,
causing a deadlock.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Added a UT case.
### Was this patch authored or co-authored using generative AI tooling?
Yes. Claude Code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]