You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Matt Foley (JIRA)" <ji...@apache.org> on 2011/05/03 04:18:03 UTC

[jira] [Created] (HDFS-1878) race condition in FSNamesystem.close() causes NullPointerException without serious consequence - TestHDFSServerPorts unit test failure

race condition in FSNamesystem.close() causes NullPointerException without serious consequence - TestHDFSServerPorts unit test failure
--------------------------------------------------------------------------------------------------------------------------------------

                 Key: HDFS-1878
                 URL: https://issues.apache.org/jira/browse/HDFS-1878
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: name-node
    Affects Versions: 0.20.204.0
            Reporter: Matt Foley
            Assignee: Matt Foley
            Priority: Minor
             Fix For: 0.20.205.0


TestHDFSServerPorts was observed to intermittently throw a NullPointerException.  This only happens when FSNamesystem.close() is called, which means system termination for the Namenode, so this is not a serious bug for .204.  TestHDFSServerPorts is more likely than normal execution to stimulate the race, because it runs two Namenodes in the same JVM, causing more interleaving and more potential to see a race condition.

The race is in FSNamesystem.close(), line 566, we have:
      if (replthread != null) replthread.interrupt();
      if (replmon != null) replmon = null;

Since the interrupted replthread is not waited on, there is a potential race condition with replmon being nulled before replthread is dead, but replthread references replmon in computeDatanodeWork() where the NullPointerException occurs.

The solution is either to wait on replthread or just don't null replmon.  The latter is preferred, since none of the sibling Namenode processing threads are waited on in close().

I'll attach a patch for .205.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HDFS-1878) TestHDFSServerPorts unit test failure - race condition in FSNamesystem.close() causes NullPointerException without serious consequence

Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-1878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Owen O'Malley updated HDFS-1878:
--------------------------------

    Fix Version/s:     (was: 0.20.205.0)

> TestHDFSServerPorts unit test failure - race condition in FSNamesystem.close() causes NullPointerException without serious consequence
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-1878
>                 URL: https://issues.apache.org/jira/browse/HDFS-1878
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 0.20.204.0
>            Reporter: Matt Foley
>            Assignee: Matt Foley
>            Priority: Minor
>             Fix For: 0.20.204.0
>
>         Attachments: 1878-1.patch
>
>
> In 20.204, TestHDFSServerPorts was observed to intermittently throw a NullPointerException.  This only happens when FSNamesystem.close() is called, which means system termination for the Namenode, so this is not a serious bug for .204.  TestHDFSServerPorts is more likely than normal execution to stimulate the race, because it runs two Namenodes in the same JVM, causing more interleaving and more potential to see a race condition.
> The race is in FSNamesystem.close(), line 566, we have:
>       if (replthread != null) replthread.interrupt();
>       if (replmon != null) replmon = null;
> Since the interrupted replthread is not waited on, there is a potential race condition with replmon being nulled before replthread is dead, but replthread references replmon in computeDatanodeWork() where the NullPointerException occurs.
> The solution is either to wait on replthread or just don't null replmon.  The latter is preferred, since none of the sibling Namenode processing threads are waited on in close().
> I'll attach a patch for .205.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HDFS-1878) TestHDFSServerPorts unit test failure - race condition in FSNamesystem.close() causes NullPointerException without serious consequence

Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-1878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Owen O'Malley updated HDFS-1878:
--------------------------------

    Fix Version/s: 0.20.204.0

> TestHDFSServerPorts unit test failure - race condition in FSNamesystem.close() causes NullPointerException without serious consequence
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-1878
>                 URL: https://issues.apache.org/jira/browse/HDFS-1878
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 0.20.204.0
>            Reporter: Matt Foley
>            Assignee: Matt Foley
>            Priority: Minor
>             Fix For: 0.20.204.0, 0.20.205.0
>
>         Attachments: 1878-1.patch
>
>
> In 20.204, TestHDFSServerPorts was observed to intermittently throw a NullPointerException.  This only happens when FSNamesystem.close() is called, which means system termination for the Namenode, so this is not a serious bug for .204.  TestHDFSServerPorts is more likely than normal execution to stimulate the race, because it runs two Namenodes in the same JVM, causing more interleaving and more potential to see a race condition.
> The race is in FSNamesystem.close(), line 566, we have:
>       if (replthread != null) replthread.interrupt();
>       if (replmon != null) replmon = null;
> Since the interrupted replthread is not waited on, there is a potential race condition with replmon being nulled before replthread is dead, but replthread references replmon in computeDatanodeWork() where the NullPointerException occurs.
> The solution is either to wait on replthread or just don't null replmon.  The latter is preferred, since none of the sibling Namenode processing threads are waited on in close().
> I'll attach a patch for .205.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-1878) TestHDFSServerPorts unit test failure - race condition in FSNamesystem.close() causes NullPointerException without serious consequence

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-1878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028286#comment-13028286 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-1878:
----------------------------------------------

+1 patch looks good.

> TestHDFSServerPorts unit test failure - race condition in FSNamesystem.close() causes NullPointerException without serious consequence
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-1878
>                 URL: https://issues.apache.org/jira/browse/HDFS-1878
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 0.20.204.0
>            Reporter: Matt Foley
>            Assignee: Matt Foley
>            Priority: Minor
>             Fix For: 0.20.205.0
>
>         Attachments: 1878-1.patch
>
>
> In 20.204, TestHDFSServerPorts was observed to intermittently throw a NullPointerException.  This only happens when FSNamesystem.close() is called, which means system termination for the Namenode, so this is not a serious bug for .204.  TestHDFSServerPorts is more likely than normal execution to stimulate the race, because it runs two Namenodes in the same JVM, causing more interleaving and more potential to see a race condition.
> The race is in FSNamesystem.close(), line 566, we have:
>       if (replthread != null) replthread.interrupt();
>       if (replmon != null) replmon = null;
> Since the interrupted replthread is not waited on, there is a potential race condition with replmon being nulled before replthread is dead, but replthread references replmon in computeDatanodeWork() where the NullPointerException occurs.
> The solution is either to wait on replthread or just don't null replmon.  The latter is preferred, since none of the sibling Namenode processing threads are waited on in close().
> I'll attach a patch for .205.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (HDFS-1878) TestHDFSServerPorts unit test failure - race condition in FSNamesystem.close() causes NullPointerException without serious consequence

Posted by "Matt Foley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-1878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Foley resolved HDFS-1878.
------------------------------

    Resolution: Fixed

Committed to 0.20-security and 0.20-security-205.

> TestHDFSServerPorts unit test failure - race condition in FSNamesystem.close() causes NullPointerException without serious consequence
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-1878
>                 URL: https://issues.apache.org/jira/browse/HDFS-1878
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 0.20.204.0
>            Reporter: Matt Foley
>            Assignee: Matt Foley
>            Priority: Minor
>             Fix For: 0.20.205.0
>
>         Attachments: 1878-1.patch
>
>
> In 20.204, TestHDFSServerPorts was observed to intermittently throw a NullPointerException.  This only happens when FSNamesystem.close() is called, which means system termination for the Namenode, so this is not a serious bug for .204.  TestHDFSServerPorts is more likely than normal execution to stimulate the race, because it runs two Namenodes in the same JVM, causing more interleaving and more potential to see a race condition.
> The race is in FSNamesystem.close(), line 566, we have:
>       if (replthread != null) replthread.interrupt();
>       if (replmon != null) replmon = null;
> Since the interrupted replthread is not waited on, there is a potential race condition with replmon being nulled before replthread is dead, but replthread references replmon in computeDatanodeWork() where the NullPointerException occurs.
> The solution is either to wait on replthread or just don't null replmon.  The latter is preferred, since none of the sibling Namenode processing threads are waited on in close().
> I'll attach a patch for .205.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HDFS-1878) TestHDFSServerPorts unit test failure - race condition in FSNamesystem.close() causes NullPointerException without serious consequence

Posted by "Matt Foley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-1878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Foley updated HDFS-1878:
-----------------------------

    Summary: TestHDFSServerPorts unit test failure - race condition in FSNamesystem.close() causes NullPointerException without serious consequence  (was: race condition in FSNamesystem.close() causes NullPointerException without serious consequence - TestHDFSServerPorts unit test failure)

> TestHDFSServerPorts unit test failure - race condition in FSNamesystem.close() causes NullPointerException without serious consequence
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-1878
>                 URL: https://issues.apache.org/jira/browse/HDFS-1878
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 0.20.204.0
>            Reporter: Matt Foley
>            Assignee: Matt Foley
>            Priority: Minor
>             Fix For: 0.20.205.0
>
>         Attachments: 1878-1.patch
>
>
> In 20.204, TestHDFSServerPorts was observed to intermittently throw a NullPointerException.  This only happens when FSNamesystem.close() is called, which means system termination for the Namenode, so this is not a serious bug for .204.  TestHDFSServerPorts is more likely than normal execution to stimulate the race, because it runs two Namenodes in the same JVM, causing more interleaving and more potential to see a race condition.
> The race is in FSNamesystem.close(), line 566, we have:
>       if (replthread != null) replthread.interrupt();
>       if (replmon != null) replmon = null;
> Since the interrupted replthread is not waited on, there is a potential race condition with replmon being nulled before replthread is dead, but replthread references replmon in computeDatanodeWork() where the NullPointerException occurs.
> The solution is either to wait on replthread or just don't null replmon.  The latter is preferred, since none of the sibling Namenode processing threads are waited on in close().
> I'll attach a patch for .205.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HDFS-1878) race condition in FSNamesystem.close() causes NullPointerException without serious consequence - TestHDFSServerPorts unit test failure

Posted by "Matt Foley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-1878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Foley updated HDFS-1878:
-----------------------------

    Attachment: 1878-1.patch

Not turning on "Submit Patch" since patch is for 20.205.

> race condition in FSNamesystem.close() causes NullPointerException without serious consequence - TestHDFSServerPorts unit test failure
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-1878
>                 URL: https://issues.apache.org/jira/browse/HDFS-1878
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 0.20.204.0
>            Reporter: Matt Foley
>            Assignee: Matt Foley
>            Priority: Minor
>             Fix For: 0.20.205.0
>
>         Attachments: 1878-1.patch
>
>
> In 20.204, TestHDFSServerPorts was observed to intermittently throw a NullPointerException.  This only happens when FSNamesystem.close() is called, which means system termination for the Namenode, so this is not a serious bug for .204.  TestHDFSServerPorts is more likely than normal execution to stimulate the race, because it runs two Namenodes in the same JVM, causing more interleaving and more potential to see a race condition.
> The race is in FSNamesystem.close(), line 566, we have:
>       if (replthread != null) replthread.interrupt();
>       if (replmon != null) replmon = null;
> Since the interrupted replthread is not waited on, there is a potential race condition with replmon being nulled before replthread is dead, but replthread references replmon in computeDatanodeWork() where the NullPointerException occurs.
> The solution is either to wait on replthread or just don't null replmon.  The latter is preferred, since none of the sibling Namenode processing threads are waited on in close().
> I'll attach a patch for .205.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HDFS-1878) TestHDFSServerPorts unit test failure - race condition in FSNamesystem.close() causes NullPointerException without serious consequence

Posted by "Matt Foley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-1878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028527#comment-13028527 ] 

Matt Foley commented on HDFS-1878:
----------------------------------

No, doesn't affect trunk.  I didn't port the QueueProcessingStatistics stuff the bug relates to, to v22, because after some experience with it I concluded it was better to just use simple logs.

> TestHDFSServerPorts unit test failure - race condition in FSNamesystem.close() causes NullPointerException without serious consequence
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-1878
>                 URL: https://issues.apache.org/jira/browse/HDFS-1878
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 0.20.204.0
>            Reporter: Matt Foley
>            Assignee: Matt Foley
>            Priority: Minor
>             Fix For: 0.20.205.0
>
>         Attachments: 1878-1.patch
>
>
> In 20.204, TestHDFSServerPorts was observed to intermittently throw a NullPointerException.  This only happens when FSNamesystem.close() is called, which means system termination for the Namenode, so this is not a serious bug for .204.  TestHDFSServerPorts is more likely than normal execution to stimulate the race, because it runs two Namenodes in the same JVM, causing more interleaving and more potential to see a race condition.
> The race is in FSNamesystem.close(), line 566, we have:
>       if (replthread != null) replthread.interrupt();
>       if (replmon != null) replmon = null;
> Since the interrupted replthread is not waited on, there is a potential race condition with replmon being nulled before replthread is dead, but replthread references replmon in computeDatanodeWork() where the NullPointerException occurs.
> The solution is either to wait on replthread or just don't null replmon.  The latter is preferred, since none of the sibling Namenode processing threads are waited on in close().
> I'll attach a patch for .205.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HDFS-1878) race condition in FSNamesystem.close() causes NullPointerException without serious consequence - TestHDFSServerPorts unit test failure

Posted by "Matt Foley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-1878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Foley updated HDFS-1878:
-----------------------------

    Description: 
In 20.204, TestHDFSServerPorts was observed to intermittently throw a NullPointerException.  This only happens when FSNamesystem.close() is called, which means system termination for the Namenode, so this is not a serious bug for .204.  TestHDFSServerPorts is more likely than normal execution to stimulate the race, because it runs two Namenodes in the same JVM, causing more interleaving and more potential to see a race condition.

The race is in FSNamesystem.close(), line 566, we have:
      if (replthread != null) replthread.interrupt();
      if (replmon != null) replmon = null;

Since the interrupted replthread is not waited on, there is a potential race condition with replmon being nulled before replthread is dead, but replthread references replmon in computeDatanodeWork() where the NullPointerException occurs.

The solution is either to wait on replthread or just don't null replmon.  The latter is preferred, since none of the sibling Namenode processing threads are waited on in close().

I'll attach a patch for .205.


  was:
TestHDFSServerPorts was observed to intermittently throw a NullPointerException.  This only happens when FSNamesystem.close() is called, which means system termination for the Namenode, so this is not a serious bug for .204.  TestHDFSServerPorts is more likely than normal execution to stimulate the race, because it runs two Namenodes in the same JVM, causing more interleaving and more potential to see a race condition.

The race is in FSNamesystem.close(), line 566, we have:
      if (replthread != null) replthread.interrupt();
      if (replmon != null) replmon = null;

Since the interrupted replthread is not waited on, there is a potential race condition with replmon being nulled before replthread is dead, but replthread references replmon in computeDatanodeWork() where the NullPointerException occurs.

The solution is either to wait on replthread or just don't null replmon.  The latter is preferred, since none of the sibling Namenode processing threads are waited on in close().

I'll attach a patch for .205.



> race condition in FSNamesystem.close() causes NullPointerException without serious consequence - TestHDFSServerPorts unit test failure
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-1878
>                 URL: https://issues.apache.org/jira/browse/HDFS-1878
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 0.20.204.0
>            Reporter: Matt Foley
>            Assignee: Matt Foley
>            Priority: Minor
>             Fix For: 0.20.205.0
>
>
> In 20.204, TestHDFSServerPorts was observed to intermittently throw a NullPointerException.  This only happens when FSNamesystem.close() is called, which means system termination for the Namenode, so this is not a serious bug for .204.  TestHDFSServerPorts is more likely than normal execution to stimulate the race, because it runs two Namenodes in the same JVM, causing more interleaving and more potential to see a race condition.
> The race is in FSNamesystem.close(), line 566, we have:
>       if (replthread != null) replthread.interrupt();
>       if (replmon != null) replmon = null;
> Since the interrupted replthread is not waited on, there is a potential race condition with replmon being nulled before replthread is dead, but replthread references replmon in computeDatanodeWork() where the NullPointerException occurs.
> The solution is either to wait on replthread or just don't null replmon.  The latter is preferred, since none of the sibling Namenode processing threads are waited on in close().
> I'll attach a patch for .205.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HDFS-1878) TestHDFSServerPorts unit test failure - race condition in FSNamesystem.close() causes NullPointerException without serious consequence

Posted by "Eli Collins (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-1878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028505#comment-13028505 ] 

Eli Collins commented on HDFS-1878:
-----------------------------------

Does this affect trunk?

> TestHDFSServerPorts unit test failure - race condition in FSNamesystem.close() causes NullPointerException without serious consequence
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-1878
>                 URL: https://issues.apache.org/jira/browse/HDFS-1878
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 0.20.204.0
>            Reporter: Matt Foley
>            Assignee: Matt Foley
>            Priority: Minor
>             Fix For: 0.20.205.0
>
>         Attachments: 1878-1.patch
>
>
> In 20.204, TestHDFSServerPorts was observed to intermittently throw a NullPointerException.  This only happens when FSNamesystem.close() is called, which means system termination for the Namenode, so this is not a serious bug for .204.  TestHDFSServerPorts is more likely than normal execution to stimulate the race, because it runs two Namenodes in the same JVM, causing more interleaving and more potential to see a race condition.
> The race is in FSNamesystem.close(), line 566, we have:
>       if (replthread != null) replthread.interrupt();
>       if (replmon != null) replmon = null;
> Since the interrupted replthread is not waited on, there is a potential race condition with replmon being nulled before replthread is dead, but replthread references replmon in computeDatanodeWork() where the NullPointerException occurs.
> The solution is either to wait on replthread or just don't null replmon.  The latter is preferred, since none of the sibling Namenode processing threads are waited on in close().
> I'll attach a patch for .205.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira