You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Rakesh R (JIRA)" <ji...@apache.org> on 2013/10/30 10:50:26 UTC

[jira] [Commented] (BOOKKEEPER-700) GarbageCollectorThread exsiting with ArrayIndexOutOfBoundsException

    [ https://issues.apache.org/jira/browse/BOOKKEEPER-700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13808901#comment-13808901 ] 

Rakesh R commented on BOOKKEEPER-700:
-------------------------------------

Here to fix this, I just made simple size check. Could you please review the changes. Thanks.

While seeing this issue, I just noticed one case. If a thread is a critical thread(for ex: GarbageCollectorThread) and assume any unexpected exceptions occured, it may exit without any logs and makes debugging difficult.

*Proposal:*
If we have ThreadGroup exception handler to all the threads and will define setUncaughtExceptionHandler to caught all exceptions thrown by Thread run methods.
IMHO, one way to address this would be to create a common 'BookieThread' that all the threads must extend and every thread can define following properties:
# threadName, 
# isUnhandledExceptionFatal - if yes log as fatal error and call System.exit(errcode), otw just log with priority level error and continue running server.

Shall I raise a separate JIRA for this thought and work for the same. Whats your opinion?

> GarbageCollectorThread exsiting with ArrayIndexOutOfBoundsException
> -------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-700
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-700
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-server
>            Reporter: Rakesh R
>            Assignee: Rakesh R
>             Fix For: 4.3.0
>
>         Attachments: 0001-BOOKKEEPER-700.patch
>
>
> After completing compaction, GarbageCollectorThread will do flush any outstanding offsets. When there is no offset present, its throwing following exception and exiting.
> {code}
> 2013-10-30 11:37:20,944 - ERROR - [GarbageCollectorThread:NIOServerCnxnFactory$1@49] - Thread Thread[GarbageCollectorThread,5,main] died
> java.lang.ArrayIndexOutOfBoundsException: -1
> 	at java.util.ArrayList.get(ArrayList.java:324)
> 	at org.apache.bookkeeper.bookie.GarbageCollectorThread$CompactionScannerFactory.waitEntrylogFlushed(GarbageCollectorThread.java:151)
> 	at org.apache.bookkeeper.bookie.GarbageCollectorThread$CompactionScannerFactory.flush(GarbageCollectorThread.java:175)
> 	at org.apache.bookkeeper.bookie.GarbageCollectorThread.doCompactEntryLogs(GarbageCollectorThread.java:400)
> 	at org.apache.bookkeeper.bookie.GarbageCollectorThread.run(GarbageCollectorThread.java:309)
> {code}



--
This message was sent by Atlassian JIRA
(v6.1#6144)