Issue Details (XML | Word | Printable)

Key: HADOOP-4526
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Hairong Kuang
Reporter: Koji Noguchi
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

fsck failing with NullPointerException (return value 0)

Created: 27/Oct/08 09:27 PM   Updated: 08/Jul/09 04:43 PM
Return to search
Component/s: None
Affects Version/s: 0.18.1
Fix Version/s: 0.18.2

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works fsckNPE-br18.patch 2008-10-28 11:23 PM Hairong Kuang 0.6 kB
Text File Licensed for inclusion in ASF works fsckNPE.patch 2008-10-27 11:52 PM Hairong Kuang 0.7 kB
Environment: 0.18.1_H4277_H4271_H4326_H4314_H4395_H4351_H4407_H3217

Hadoop Flags: Reviewed
Resolution Date: 28/Oct/08 11:26 PM


 Description  « Hide
fsck is siliently dying with return value of 0.

Namenode log showing
2008-10-27 07:57:00,514 WARN /: /fsck?path=%2F:
java.lang.NullPointerException

No stack trace.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Koji Noguchi added a comment - 27/Oct/08 10:03 PM
Reproduced the problem on a singlenode cluster by inserting some sleep.
Very similar issue with HADOOP-3107.
It somehow prints out the full stacktrace to the log only when there's no successful fsck before that.
(I believe it's an uncaught exception)
2008-10-27 21:50:17,285 WARN /: /fsck?path=%2Fuser:
java.lang.NullPointerException
  at org.apache.hadoop.dfs.NamenodeFsck.check(NamenodeFsck.java:172)
  at org.apache.hadoop.dfs.NamenodeFsck.check(NamenodeFsck.java:166)
  at org.apache.hadoop.dfs.NamenodeFsck.fsck(NamenodeFsck.java:129)
  at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:48)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
  at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
  at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
  at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
  at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
  at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
  at org.mortbay.http.HttpServer.service(HttpServer.java:954)
  at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
  at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
  at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
  at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
  at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
  at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
NamenodeFsck.java
171     LocatedBlocks blocks = nn.namesystem.getBlockLocations(path, 0, fileLen);
172     isOpen = blocks.isUnderConstruction();

Hairong Kuang added a comment - 27/Oct/08 11:52 PM
This simple patch fixes the NPE problem.

Konstantin Shvachko added a comment - 28/Oct/08 12:23 AM
+1
We generally accept files with no blocks. It should be reflected in fsck.

Hairong Kuang added a comment - 28/Oct/08 10:46 PM
I ran anttest-core on the patch on my local machine. The build was successfully finished.

Here was the result of ant test-patch:

[exec] -1 overall.

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

[exec] -1 tests included. The patch doesn't appear to include anynew or modified tests.
[exec] Please justify why no tests are needed for this patch.

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

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

[exec] +1 findbugs. The patch does not introduce any new Findbugswarnings.

[exec] +1 Eclipse classpath. The patch retains Eclipse classpath integrity.

I have manually tested the patch and it showed the patch solved the NPE problem.


Hairong Kuang added a comment - 28/Oct/08 11:23 PM
The patch for branch 0.18.

Hairong Kuang added a comment - 28/Oct/08 11:26 PM
I just committed this.

Hudson added a comment - 29/Oct/08 02:39 PM
Integrated in Hadoop-trunk #646 (See http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/646/)
. fsck failing with NullPointerException. Contributed by Hairong Kuang.