PARQUET-431: Make ParquetOutputFormat.memoryManager volatile - #313
Closed
lw-lin wants to merge 5 commits into
Closed
PARQUET-431: Make ParquetOutputFormat.memoryManager volatile#313lw-lin wants to merge 5 commits into
lw-lin wants to merge 5 commits into
Conversation
Contributor
Author
|
This is fairly a small change, @rdblue @liancheng would you please take a look at this? |
Contributor
|
+1 |
Member
|
should we not have a synchronized block around the if (memoryManager == null) ... ? |
…getMemoryManager() Adds synchronization around the creation of memoryManager as well as getMemoryManager()
Contributor
Author
|
@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! |
Member
There was a problem hiding this comment.
volatile is not needed anymore
Member
|
+1 |
piyushnarang
pushed a commit
to piyushnarang/parquet-mr
that referenced
this pull request
Jun 15, 2016
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
rdblue
pushed a commit
to rdblue/parquet-mr
that referenced
this pull request
Jul 13, 2016
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
rdblue
pushed a commit
to rdblue/parquet-mr
that referenced
this pull request
Jan 6, 2017
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
rdblue
pushed a commit
to rdblue/parquet-mr
that referenced
this pull request
Jan 10, 2017
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.