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

Appy commented on HBASE-19527:
------------------------------

Idk what's good - make them deamon thread or not. Been trying to reason in my 
head for quite a while now, but can't answer for sure. Just adding some 
thoughts here.
WorkerThread class in ProcExecutor can stop itself if it's idle and the server 
is going down. But what about the threads doing actual work?

Making daemon thread
- Pro: master shutdown will not get stuck in any case
- Con: Our 'clean' shutdown isn't exactly clean, it'll crash end many 
background work like create table, merge regions, and anything that we aim to 
build on top of proc framework - backup, replication, etc

Not making threads daemon:
- Pro: Reliably ending ongoing work at defined sync points
- Cons: Master shutdown can get stuck

I personally hate landing in a place where our 'clean' shutdown will actually 
be like a crash.
One alternative I have is:
Don't make them daemon threads. Start a ShutdownMonitor thread in 
HMaster.stop() (which should be Daemon thread) and if it finds itself running 
for more than X seconds, then call System.exit() (with a nice msg on why such 
abruptness of course).


> Make ExecutorService threads daemon=true.
> -----------------------------------------
>
>                 Key: HBASE-19527
>                 URL: https://issues.apache.org/jira/browse/HBASE-19527
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: stack
>            Assignee: stack
>            Priority: Major
>             Fix For: 2.0.0-beta-2
>
>         Attachments: HBASE-19527.branch-2.001.patch, 
> HBASE-19527.branch-2.002.patch, HBASE-19527.master.001.patch, 
> HBASE-19527.master.001.patch, HBASE-19527.master.001.patch, 
> HBASE-19527.master.002.patch
>
>
> Let me try this. ExecutorService runs OPENs, CLOSE, etc. If Server is going 
> down, no point in these threads sticking around (I think). Let me try this.



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

Reply via email to