-
Notifications
You must be signed in to change notification settings - Fork 915
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
Java cleaner synchronization [skip ci] #7474
Java cleaner synchronization [skip ci] #7474
Conversation
I am running some tests on this but posting as draft for now. |
I am not seeing unit test failures as a result of this change in cudf or the Spark plugin, |
@@ -114,7 +114,7 @@ public String toString() { | |||
} | |||
|
|||
@Override | |||
public void close() { | |||
public synchronized void close() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to synchronize closing a stream, but none of the other classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the other classes synchronized on close, except Stream
and Event
. As of this PR, these don't synchronize:
HostColumnVectorCore
(as far as as I can tell itsclose
is overwritten by subclasses)- nvcomp:
BatchedMetadata
andMetadata
. Neither of these are called in a multi-threaded context.
I think we can synchronize close for the nvcomp ones, that seems like it could be a miss later. If you think this is unnecessary let me know and I can revert parts of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HostColumnVectorCore
(as far as as I can tell itsclose
is overwritten by subclasses)
Child columns are instances of this class. So we should probably add synchronized
to the close in HostColumnVectorCore
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@revans2 did you want me to make a change around this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok done. I need to re-run my tests after upmerging. FYI.
@abellina Please edit the PR description (which becomes part of the commit message) to drop the mention of a draft and I think this is good to go. |
Done! |
@gpucibot merge |
Add synchronization in `cleanImpl` and `close` in various places where race conditions could exist, and also within the `MemoryCleaner` to address some concurrent modification issues we've seen in tests while shutting down (i.e. invoking the cleaner) (i.e. NVIDIA/spark-rapids#1797) Authors: - Alessandro Bellina (@abellina) Approvers: - Robert (Bobby) Evans (@revans2) - Jason Lowe (@jlowe) URL: rapidsai#7474
Add synchronization in
cleanImpl
andclose
in various places where race conditions could exist, and also within theMemoryCleaner
to address some concurrent modification issues we've seen in tests while shutting down (i.e. invoking the cleaner) (i.e. NVIDIA/spark-rapids#1797)