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

Reid Chan commented on HBASE-20808:
-----------------------------------

Let's do some more cleaning if you would like to. The idea is to make use of 
the existed method.

All
{code}
if (ScheduledChore != null) ScheduledChore.cancel(true)
{code}
can be replaced with the following,
{code}
getChoreService().cancelChore(ScheduledChore);
{code}

Here's the snippet after modification, method 
{{HMaster#cancelChore(ScheduledChore)}} are redundant codes.
{code:title=HMaster#stopChores()}
  private void stopChores() {
    getChoreService().cancelChore(this.expiredMobFileCleanerChore);
    getChoreService().cancelChore(this.mobCompactChore);
    ...
    getChoreService().cancelChore(this.replicationBarrierCleaner);
    if (this.mobCompactThread != null) {
      this.mobCompactThread.close();
    }
  }
{code} 
Can do the same in HRegionServer.

> Wrong shutdown order between Chores and ChoreService
> ----------------------------------------------------
>
>                 Key: HBASE-20808
>                 URL: https://issues.apache.org/jira/browse/HBASE-20808
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Reid Chan
>            Assignee: Nihal Jain
>            Priority: Minor
>              Labels: beginner
>         Attachments: HBASE-20808.master.001.patch, 
> HBASE-20808.master.002.patch, HBASE-20808.master.003.patch
>
>
> When stopping master, {{ChoreService}}, which serves all the chores, is 
> stopped before canceling all running chores.
> It should cancel all running chores, then shutdown {{ChoreService}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to