-
Notifications
You must be signed in to change notification settings - Fork 1.5k
PARQUET-431: Make ParquetOutputFormat.memoryManager volatile #313
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
Conversation
|
This is fairly a small change, @rdblue @liancheng would you please take a look at this? |
|
+1 |
|
should we not have a synchronized block around the if (memoryManager == null) ... ? |
…getMemoryManager() Adds synchronization around the creation of memoryManager as well as getMemoryManager()
|
@julienledem Thanks for reviewing and pointing that out. I think we should have the synchronized block. The latest commit adds this synchronized block for both memoryManager creation snippet and getMemoryManager() method. Would you take another look please? Thanks! |
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.
volatile is not needed anymore
|
+1 |
Currently ParquetOutputFormat.getRecordWriter() contains an unsynchronized lazy initialization of the non-volatile static field *memoryManager*. Because the compiler or processor may reorder instructions, threads are not guaranteed to see a completely initialized object, when ParquetOutputFormat.getRecordWriter() is called by multiple threads. This PR makes *memoryManager* volatile to correct the problem. Author: Liwei Lin <proflin.me@gmail.com> Author: proflin <proflin.me@gmail.com> Closes apache#313 from proflin/PARQUET-431 and squashes the following commits: 1aa4a44 [Liwei Lin] empty commit to trigger CI 5e94fa3 [Liwei Lin] Remove the volatile modifier for memoryManager d54bb99 [Liwei Lin] Undo the Deprecated anotation fd1df4e [Liwei Lin] Adds synchronization around the creation of memoryManager as well as getMemoryManager() 615aa5a [proflin] PARQUET-431
Currently ParquetOutputFormat.getRecordWriter() contains an unsynchronized lazy initialization of the non-volatile static field *memoryManager*. Because the compiler or processor may reorder instructions, threads are not guaranteed to see a completely initialized object, when ParquetOutputFormat.getRecordWriter() is called by multiple threads. This PR makes *memoryManager* volatile to correct the problem. Author: Liwei Lin <proflin.me@gmail.com> Author: proflin <proflin.me@gmail.com> Closes apache#313 from proflin/PARQUET-431 and squashes the following commits: 1aa4a44 [Liwei Lin] empty commit to trigger CI 5e94fa3 [Liwei Lin] Remove the volatile modifier for memoryManager d54bb99 [Liwei Lin] Undo the Deprecated anotation fd1df4e [Liwei Lin] Adds synchronization around the creation of memoryManager as well as getMemoryManager() 615aa5a [proflin] PARQUET-431
Currently ParquetOutputFormat.getRecordWriter() contains an unsynchronized lazy initialization of the non-volatile static field *memoryManager*. Because the compiler or processor may reorder instructions, threads are not guaranteed to see a completely initialized object, when ParquetOutputFormat.getRecordWriter() is called by multiple threads. This PR makes *memoryManager* volatile to correct the problem. Author: Liwei Lin <proflin.me@gmail.com> Author: proflin <proflin.me@gmail.com> Closes apache#313 from proflin/PARQUET-431 and squashes the following commits: 1aa4a44 [Liwei Lin] empty commit to trigger CI 5e94fa3 [Liwei Lin] Remove the volatile modifier for memoryManager d54bb99 [Liwei Lin] Undo the Deprecated anotation fd1df4e [Liwei Lin] Adds synchronization around the creation of memoryManager as well as getMemoryManager() 615aa5a [proflin] PARQUET-431
Currently ParquetOutputFormat.getRecordWriter() contains an unsynchronized lazy initialization of the non-volatile static field *memoryManager*. Because the compiler or processor may reorder instructions, threads are not guaranteed to see a completely initialized object, when ParquetOutputFormat.getRecordWriter() is called by multiple threads. This PR makes *memoryManager* volatile to correct the problem. Author: Liwei Lin <proflin.me@gmail.com> Author: proflin <proflin.me@gmail.com> Closes apache#313 from proflin/PARQUET-431 and squashes the following commits: 1aa4a44 [Liwei Lin] empty commit to trigger CI 5e94fa3 [Liwei Lin] Remove the volatile modifier for memoryManager d54bb99 [Liwei Lin] Undo the Deprecated anotation fd1df4e [Liwei Lin] Adds synchronization around the creation of memoryManager as well as getMemoryManager() 615aa5a [proflin] PARQUET-431
Currently ParquetOutputFormat.getRecordWriter() contains an unsynchronized lazy initialization of the non-volatile static field memoryManager.
Because the compiler or processor may reorder instructions, threads are not guaranteed to see a completely initialized object, when ParquetOutputFormat.getRecordWriter() is called by multiple threads.
This PR makes memoryManager volatile to correct the problem.