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

Ivan Kelly commented on BOOKKEEPER-248:
---------------------------------------

{quote}
Shall I handle that bug along with this JIRA?
{quote}
This should be in another JIRA. I think the fix is quite simple, as you say 
(add watcher again by calling exists again after NodeExistsException).

The NPE I was speaking of may not actually exist, but the way it is implemented 
it looks very possible. In #stop you close the underreplLM and bkc. This 
uninitializes both these objects. However, to stop #run, you only set 
workerRunning to false, which allows #run to keep going until the next 
iteration of the while loop, possibly using the underreplLM and bkc which you 
have just uninitialized. So any issue may not be a NPE exactly, but it could 
well be some problem of the same type. Really, what you need to do here, is 
have #stop() block until #run() has finished, and then cleanly the bkc etc. A 
countdownlatch would do it. Or alternatively, ReplicationWorker could own the 
Thread object which is being used to run it [1], and then #stop() could join() 
the thread to wait for it to finish.

[1] Don't start the thread from the ctor, have a explicit start() method. 
Starting from the ctor makes unit testing a pain, and causes findbugs issues.


                
> Rereplicating of under replicated data
> --------------------------------------
>
>                 Key: BOOKKEEPER-248
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-248
>             Project: Bookkeeper
>          Issue Type: Sub-task
>          Components: bookkeeper-auto-recovery
>            Reporter: Ivan Kelly
>            Assignee: Uma Maheswara Rao G
>             Fix For: 4.2.0
>
>         Attachments: BOOKKEEPER-248.patch, BOOKKEEPER-248.patch
>
>
> This subtask discusses how we will rereplicate underreplicated entries.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to