Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-2533

Remove needless synchronization on FSDataSet.getBlockFile

    Details

    • Hadoop Flags:
      Reviewed
    • Target Version/s:

      Description

      HDFS-1148 discusses lock contention issues in FSDataset. It provides a more comprehensive fix, converting it all to RWLocks, etc. This JIRA is for one very specific fix which gives a decent performance improvement for TestParallelRead: getBlockFile() currently holds the lock which is completely unnecessary.

      1. hdfs-2533.txt
        0.9 kB
        Todd Lipcon
      2. hdfs-2533.txt
        3 kB
        Todd Lipcon
      3. HDFS-2533.branch-1.patch
        3 kB
        Brandon Li

        Activity

        Hide
        Tsz Wo Nicholas Sze added a comment -

        I have committed the backport patch to branch-1. Thanks, Brandon!

        Show
        Tsz Wo Nicholas Sze added a comment - I have committed the backport patch to branch-1. Thanks, Brandon!
        Hide
        Tsz Wo Nicholas Sze added a comment -

        +1 the branch-1 patch looks good.

        Show
        Tsz Wo Nicholas Sze added a comment - +1 the branch-1 patch looks good.
        Hide
        Brandon Li added a comment -

        I did teragen/terasort/teravalid with the branch-1 patch and noticed some performance gain in terasort and teravalid, no noticeable performance gain with teragen.

        Show
        Brandon Li added a comment - I did teragen/terasort/teravalid with the branch-1 patch and noticed some performance gain in terasort and teravalid, no noticeable performance gain with teragen.
        Hide
        Brandon Li added a comment -

        Just noticed that this JIRA is interesting. Basically it moves File.exists() call out of the lock and it could make non-trivial performance improvement. Depends on the workload, the cost of File.exists() call can be variant and thus the gain of this patch.

        Here is a discussion of the cost of File.exists(): http://stackoverflow.com/questions/6321180/how-expensive-is-file-exists-in-java

        I did a test on my laptop(Darwin Kernel Version 11.3.0). For a non-exist file, the first check took 30ms.

        Uploaded a patch for branch-1.

        Show
        Brandon Li added a comment - Just noticed that this JIRA is interesting. Basically it moves File.exists() call out of the lock and it could make non-trivial performance improvement. Depends on the workload, the cost of File.exists() call can be variant and thus the gain of this patch. Here is a discussion of the cost of File.exists(): http://stackoverflow.com/questions/6321180/how-expensive-is-file-exists-in-java I did a test on my laptop(Darwin Kernel Version 11.3.0). For a non-exist file, the first check took 30ms. Uploaded a patch for branch-1.
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #886 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/886/)
        HDFS-2533. Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon.

        todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196902
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #886 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/886/ ) HDFS-2533 . Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon. todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196902 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-0.23-Build #79 (See https://builds.apache.org/job/Hadoop-Mapreduce-0.23-Build/79/)
        HDFS-2533. Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon.

        todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196901
        Files :

        • /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-0.23-Build #79 (See https://builds.apache.org/job/Hadoop-Mapreduce-0.23-Build/79/ ) HDFS-2533 . Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon. todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196901 Files : /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #852 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/852/)
        HDFS-2533. Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon.

        todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196902
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #852 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/852/ ) HDFS-2533 . Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon. todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196902 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-0.23-Build #65 (See https://builds.apache.org/job/Hadoop-Hdfs-0.23-Build/65/)
        HDFS-2533. Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon.

        todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196901
        Files :

        • /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-0.23-Build #65 (See https://builds.apache.org/job/Hadoop-Hdfs-0.23-Build/65/ ) HDFS-2533 . Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon. todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196901 Files : /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk-Commit #1260 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/1260/)
        HDFS-2533. Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon.

        todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196902
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #1260 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/1260/ ) HDFS-2533 . Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon. todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196902 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-0.23-Commit #151 (See https://builds.apache.org/job/Hadoop-Mapreduce-0.23-Commit/151/)
        HDFS-2533. Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon.

        todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196901
        Files :

        • /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-0.23-Commit #151 (See https://builds.apache.org/job/Hadoop-Mapreduce-0.23-Commit/151/ ) HDFS-2533 . Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon. todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196901 Files : /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk-Commit #1312 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/1312/)
        HDFS-2533. Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon.

        todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196902
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #1312 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/1312/ ) HDFS-2533 . Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon. todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196902 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk-Commit #1237 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/1237/)
        HDFS-2533. Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon.

        todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196902
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #1237 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/1237/ ) HDFS-2533 . Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon. todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196902 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-0.23-Commit #140 (See https://builds.apache.org/job/Hadoop-Hdfs-0.23-Commit/140/)
        HDFS-2533. Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon.

        todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196901
        Files :

        • /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-0.23-Commit #140 (See https://builds.apache.org/job/Hadoop-Hdfs-0.23-Commit/140/ ) HDFS-2533 . Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon. todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196901 Files : /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-0.23-Commit #139 (See https://builds.apache.org/job/Hadoop-Common-0.23-Commit/139/)
        HDFS-2533. Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon.

        todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196901
        Files :

        • /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Show
        Hudson added a comment - Integrated in Hadoop-Common-0.23-Commit #139 (See https://builds.apache.org/job/Hadoop-Common-0.23-Commit/139/ ) HDFS-2533 . Remove needless synchronization on some FSDataSet methods. Contributed by Todd Lipcon. todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1196901 Files : /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
        Hide
        Todd Lipcon added a comment -

        Fixed in branch-0.23 for 0.23.1. Fixed in trunk for 0.24. Thanks for the reviews!

        Show
        Todd Lipcon added a comment - Fixed in branch-0.23 for 0.23.1. Fixed in trunk for 0.24. Thanks for the reviews!
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12502057/hdfs-2533.txt
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        -1 core tests. The patch failed these unit tests:
        org.apache.hadoop.hdfs.TestFileAppend2
        org.apache.hadoop.hdfs.TestBalancerBandwidth

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/1526//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/1526//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12502057/hdfs-2533.txt against trunk revision . +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed these unit tests: org.apache.hadoop.hdfs.TestFileAppend2 org.apache.hadoop.hdfs.TestBalancerBandwidth +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/1526//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/1526//console This message is automatically generated.
        Hide
        Eli Collins added a comment -

        +1 new patch looks good.

        Show
        Eli Collins added a comment - +1 new patch looks good.
        Hide
        Todd Lipcon added a comment -

        Test results are due to TestDfsOverAvroRpc timeout. The lack of tests are because these code paths are covered by many other tests (every test that reads data!)

        Show
        Todd Lipcon added a comment - Test results are due to TestDfsOverAvroRpc timeout. The lack of tests are because these code paths are covered by many other tests (every test that reads data!)
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12502034/hdfs-2533.txt
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        -1 core tests. The patch failed these unit tests:
        org.apache.hadoop.hdfs.TestAbandonBlock

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/1523//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/1523//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12502034/hdfs-2533.txt against trunk revision . +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed these unit tests: org.apache.hadoop.hdfs.TestAbandonBlock +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/1523//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/1523//console This message is automatically generated.
        Hide
        Todd Lipcon added a comment -

        Slightly improved version. I found it was pretty trivial to fix contention in two other places: in these places we were doing a lock around an file.exists() call unnecessarily, since we were about to open the file for read right afterwards. Given that, the exists check is unnecessary - we'll get FileNotFoundException when we try to read the file.

        With this patch the numbers improve to:

        Threads Trunk HDFS-2533v2
        4 226556 KB/s 237805 KB/sec (1.05x)
        16 377474 KB/s 499399 KB/sec (1.32x)
        8 410114 KB/s 474560 KB/sec (1.15x)
        Show
        Todd Lipcon added a comment - Slightly improved version. I found it was pretty trivial to fix contention in two other places: in these places we were doing a lock around an file.exists() call unnecessarily, since we were about to open the file for read right afterwards. Given that, the exists check is unnecessary - we'll get FileNotFoundException when we try to read the file. With this patch the numbers improve to: Threads Trunk HDFS-2533 v2 4 226556 KB/s 237805 KB/sec (1.05x) 16 377474 KB/s 499399 KB/sec (1.32x) 8 410114 KB/s 474560 KB/sec (1.15x)
        Hide
        Eli Collins added a comment -

        +1

        Show
        Eli Collins added a comment - +1
        Hide
        Todd Lipcon added a comment -

        To benchmark, I jacked up the number of iterations of TestParallelRead by a factor of 10, and made it 100% random read instead of 90/10 random/sequential.

        Results on my Core i7 Q820@173Ghz (4 codes + HT):

        Threads Trunk HDFS-2533
        4 226556 KB/s 236065 KB/sec (1.04x)
        16 377474 KB/s 454362 KB/sec (1.20x)
        8 410114 KB/s 453107 KB/sec (1.10x)

        Combined with other in-flight optimizations (HDFS-2129) the difference is even more.

        Show
        Todd Lipcon added a comment - To benchmark, I jacked up the number of iterations of TestParallelRead by a factor of 10, and made it 100% random read instead of 90/10 random/sequential. Results on my Core i7 Q820@173Ghz (4 codes + HT): Threads Trunk HDFS-2533 4 226556 KB/s 236065 KB/sec (1.04x) 16 377474 KB/s 454362 KB/sec (1.20x) 8 410114 KB/s 453107 KB/sec (1.10x) Combined with other in-flight optimizations ( HDFS-2129 ) the difference is even more.
        Hide
        Todd Lipcon added a comment -

        Here's the simple patch.

        The reason this is correct is follows:

        • getBlockFile() doesn't itself access any in-memory structures. It calls validateBlockFile
        • validateBlockFile is unsynchronized. It also doesn't access any structures. It calls getFile() which is synchronized (since it accesses in-memory state). Then it calls f.exists().
        • it's safe to call f.exists() outside the lock because, even if we had the lock, someone could remove the file just after we exit this function.
        Show
        Todd Lipcon added a comment - Here's the simple patch. The reason this is correct is follows: getBlockFile() doesn't itself access any in-memory structures. It calls validateBlockFile validateBlockFile is unsynchronized. It also doesn't access any structures. It calls getFile() which is synchronized (since it accesses in-memory state). Then it calls f.exists(). it's safe to call f.exists() outside the lock because, even if we had the lock, someone could remove the file just after we exit this function.

          People

          • Assignee:
            Todd Lipcon
            Reporter:
            Todd Lipcon
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development