Created
December 28, 2015 15:16
-
-
Save emopers/fa54d1ad18f564a1e343 to your computer and use it in GitHub Desktop.
sync_col_70
This file contains 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
Title: | |
NNStorage does not synchronize iteration on a synchronized list | |
Body: | |
In line 839 of NNStroage.java#reportErrorsOnDirectories, the synchronized list, `sds` | |
is iterated in an unsynchronized manner, but according to [Oracle Java 7 API specification] | |
(http://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#synchronizedList(java.util.List)), | |
this is not thread-safe and can lead to non-deterministic behavior. | |
This pull request adds a fix by synchronizing the iteration on `sds`. The synchronized list is passed to method `reportErrorsnODirectories` from | |
[here](https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImage.java#L508) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment