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

Fix scalar leak in RankFixer #10475

Merged
merged 3 commits into from
Feb 23, 2024
Merged

Conversation

jlowe
Copy link
Member

@jlowe jlowe commented Feb 22, 2024

Fixes #10473. Updates the RankFixer.close() method to close the BatchedRunningWindowBinaryFixer instance which is caching a scalar.

Signed-off-by: Jason Lowe <jlowe@nvidia.com>
@jlowe jlowe self-assigned this Feb 22, 2024
@jlowe
Copy link
Member Author

jlowe commented Feb 22, 2024

build

@sameerz sameerz added the bug Something isn't working label Feb 22, 2024
@@ -1711,6 +1711,7 @@ class RankFixer extends BatchedRunningWindowFixer with Logging {
override def close(): Unit = {
previousRank.foreach(_.close())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we also change?

Suggested change
previousRank.foreach(_.close())
previousRank.foreach(_.safeClose())

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, it turns out that cudf.Scalar objects cannot be safeClose()d:

Error: ] /home/runner/work/spark-rapids/spark-rapids/sql-plugin/src/main/scala/com/nvidia/spark/rapids/window/GpuWindowExpression.scala:1712: value safeClose is not a member of ai.rapids.cudf.Scalar
2345
Error: [ERROR] one error found

Co-authored-by: Gera Shegalov <gshegalov@nvidia.com>
@jlowe
Copy link
Member Author

jlowe commented Feb 22, 2024

build

mythrocks
mythrocks previously approved these changes Feb 23, 2024
Copy link
Collaborator

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

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

Yikes. Good catch. Thanks for finding this, @jlowe.

P.S. I think this should be safe to check in after we revert the safeClose change. @gerashegalov, does that sound agreeable?

@mythrocks mythrocks self-requested a review February 23, 2024 00:45
Signed-off-by: Gera Shegalov <gera@apache.org>
@gerashegalov
Copy link
Collaborator

@mythrocks it just needs an RapidsPluginImplicits import

@gerashegalov gerashegalov self-requested a review February 23, 2024 04:21
@gerashegalov
Copy link
Collaborator

build

Copy link
Collaborator

@gerashegalov gerashegalov left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

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

Thanks! TIL RapidsPluginImplicits.

@jlowe
Copy link
Member Author

jlowe commented Feb 23, 2024

Thanks for the import fix, @gerashegalov!

@jlowe jlowe merged commit cf32321 into NVIDIA:branch-24.02 Feb 23, 2024
38 of 39 checks passed
@jlowe jlowe deleted the fix-window-rank-leak branch February 23, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants