HBASE-25887 Wait for appendExecutor to shutdown running tasks (#3264)

Co-authored-by: Rushabh <rushabh.shah@salesforce.com>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
Signed-off-by: Bharath Vissapragada <bharathv@apache.org>
This commit is contained in:
Rushabh Shah 2021-05-25 23:03:23 -04:00 committed by GitHub
parent c0ee153c90
commit 130d6a1f15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1098,6 +1098,9 @@ public class FSHLog implements WAL {
@Override
public void shutdown() throws IOException {
if (shutdown.compareAndSet(false, true)) {
// Close FSHlog instance before shutting down disruptor. This will make sure we will not
// add more entries to ring buffer (via append) while we disruptor#shutdown is in progress.
this.closed = true;
try {
// Prevent all further flushing and rolling.
closeBarrier.stopAndDrainOps();
@ -1129,7 +1132,7 @@ public class FSHLog implements WAL {
i.logCloseRequested();
}
}
this.closed = true;
if (LOG.isDebugEnabled()) {
LOG.debug("Closing WAL writer in " + FSUtils.getPath(fullPathLogDir));
}