Skip to content

Commit db0cb96

Browse files
author
RongtongJin
committed
Add a FileNotFoundException check to allow breaking out of the loop after shutdown.
Change-Id: I53a7d2800775d80c1db8feb159c5c258b3517f09
1 parent 84c924d commit db0cb96

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

tieredstore/src/main/java/org/apache/rocketmq/tieredstore/index/IndexStoreFile.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ public void shutdown() {
477477
this.compactMappedFile.shutdown(TimeUnit.SECONDS.toMillis(10));
478478
this.compactMappedFile.cleanResources();
479479
}
480-
} catch (Exception e) {
480+
} catch (Throwable e) {
481481
log.error("IndexStoreFile shutdown failed, timestamp: {}, status: {}", this.getTimestamp(), fileStatus.get(), e);
482482
} finally {
483483
fileReadWriteLock.writeLock().unlock();

tieredstore/src/main/java/org/apache/rocketmq/tieredstore/index/IndexStoreService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,13 +438,14 @@ public void run() {
438438
if (autoCreateNewFile) {
439439
this.forceUpload();
440440
}
441-
this.timeStoreTable.forEach((timestamp, file) -> file.shutdown());
442-
this.timeStoreTable.clear();
443441
} catch (Exception e) {
444442
log.error("IndexStoreService shutdown error", e);
445443
} finally {
444+
this.timeStoreTable.forEach((timestamp, file) -> file.shutdown());
445+
this.timeStoreTable.clear();
446446
readWriteLock.writeLock().unlock();
447447
}
448+
448449
log.info(this.getServiceName() + " service shutdown");
449450
}
450451
}

0 commit comments

Comments
 (0)