You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by emopers <gi...@git.apache.org> on 2015/12/30 10:46:29 UTC

[GitHub] hadoop pull request: NNStorage does not synchronize iteration on a...

GitHub user emopers opened a pull request:

    https://github.com/apache/hadoop/pull/64

    NNStorage does not synchronize iteration on a synchronized list

    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)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/emopers/hadoop sync_col_70

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/hadoop/pull/64.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #64
    
----
commit 3c6c1d973cb978166da32451503e9a8d0d1063b5
Author: emopers <em...@gmail.com>
Date:   2015-12-28T14:59:56Z

    Added synchronized when iterating over synchronizedList as per Java specification

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] hadoop pull request: NNStorage does not synchronize iteration on a...

Posted by raviprak-altiscale <gi...@git.apache.org>.
Github user raviprak-altiscale commented on the pull request:

    https://github.com/apache/hadoop/pull/64#issuecomment-168770287
  
    Thanks for your contribution emopers. Could you please follow these steps? https://wiki.apache.org/hadoop/HowToContribute


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---