Github user paul-rogers commented on the issue:
https://github.com/apache/drill/pull/921
Interesting issue! Let's think about this a bit.
In a production system, we do want the grace period; it is an essential
part of the graceful shutdown procedure.
However, if we are doing a non-graceful shutdown, the grace is unneeded.
Also, if the cluster contains only one node (as in most unit tests), there
is nothing to wait for, so the grace period is not needed. The same is true in
an embedded Drillbit for Sqlline.
So, can we provide a solution that handles these cases rather than simply
turning off the grace period always?
If using the local cluster coordinator, say, then no grace is needed. If
using ZK, but there is only one Drillbit, no grace is needed. (There is a race
condition, but may be OK.)
Or, if we detect we are embedded, no grace period.
Then, also, if we are doing a graceful shutdown, we need the grace. But, if
we are doing a "classic" shutdown, no grace is needed.
The result should be that the grace period is used only in production
servers, only when doing a graceful shutdown.
There are probably some details to simplify, but I hope the above
communicates the idea. Can we make this work?
---