Skip to content

fix: log shuffle-manager-missing warning once per session#4378

Draft
andygrove wants to merge 1 commit into
apache:mainfrom
andygrove:log-once-shuffle-manager-warning
Draft

fix: log shuffle-manager-missing warning once per session#4378
andygrove wants to merge 1 commit into
apache:mainfrom
andygrove:log-once-shuffle-manager-warning

Conversation

@andygrove
Copy link
Copy Markdown
Member

Which issue does this PR close?

Refs #4377.

Rationale for this change

CometSparkSessionExtensions.isCometLoaded runs from CometScanRule._apply and CometExecRule._apply, i.e. on every plan rule application. The warning added in #4328 therefore fires many times per query for any session that does not register CometShuffleManager. In the Spark SQL CI matrix this surfaces as hundreds of duplicate WARN lines per affected suite (e.g. BroadcastJoinSuiteAE emitted ~304 in a single 4.1.1 run).

Whether those suites should be running with the Comet shuffle manager is a separate question tracked in #4377. This PR addresses the log-spam side of the regression so the warning is still useful as a once-per-session signal.

What changes are included in this PR?

  • Add a synchronized weak set keyed by SQLConf in CometSparkSessionExtensions.
  • isCometLoaded now only emits the warning the first time it observes a given session missing the shuffle manager. Entries are dropped when the SQLConf is GC'd, so this cannot grow unboundedly across test JVMs.
  • Return value behavior is unchanged.

How are these changes tested?

  • CometSparkSessionExtensionsSuite — both isCometLoaded tests still pass (they assert boolean return values, which are unchanged).

isCometLoaded runs from every plan rule application, so the warning
introduced in apache#4328 was emitted hundreds of times per Spark SQL test
suite for sessions that never register CometShuffleManager. Track
SQLConf identities in a synchronized weak set so the warning fires at
most once per session.

Refs apache#4377.
@andygrove andygrove marked this pull request as draft May 21, 2026 14:10
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.

1 participant