You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "XComp (via GitHub)" <gi...@apache.org> on 2023/10/04 07:53:21 UTC
Re: [PR] [FLINK-32445][runtime] Refactor BlobStoreService's closeAndCleanupAllData to cleanupAllData [flink]
XComp commented on code in PR #23424:
URL: https://github.com/apache/flink/pull/23424#discussion_r1345334927
##########
flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/AbstractHaServices.java:
##########
@@ -192,32 +192,18 @@ public void closeAndCleanupAllData() throws Exception {
try {
internalCleanup();
deletedHAData = true;
+ blobStoreService.cleanupAllData();
} catch (Exception t) {
exception = t;
}
- try {
- if (leaderElectionService != null) {
- leaderElectionService.close();
- }
- } catch (Throwable t) {
- exception = ExceptionUtils.firstOrSuppressed(t, exception);
+ if (!deletedHAData) {
+ logger.info(
+ "Cannot delete HA blobs because we failed to delete the pointers in the HA store.");
}
try {
- internalClose();
- } catch (Throwable t) {
- exception = ExceptionUtils.firstOrSuppressed(t, exception);
- }
-
- try {
- if (deletedHAData) {
- blobStoreService.closeAndCleanupAllData();
- } else {
- logger.info(
- "Cannot delete HA blobs because we failed to delete the pointers in the HA store.");
- blobStoreService.close();
- }
+ close();
Review Comment:
I'm wondering whether we should apply the same pattern to the `HighAvailabilityServices` interface. There we have two methods `close()` and `closeAndCleanupAllData()` which are then called [MiniCluster#terminateMiniClusterServices(boolean):1281ff](https://github.com/apache/flink/blob/603181da811edb47c0d573492639a381fbbedc28/flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/MiniCluster.java#L1281) and [ClusterEntrypoint#stopClusterServices(boolean):503ff](https://github.com/apache/flink/blob/603181da811edb47c0d573492639a381fbbedc28/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterEntrypoint.java#L503) respectively.
Instead, `HighAvailabilityServices` could implement `AutoCloseable` and `closeAndCleanupAllData` will be refactored to `cleanupAllData()`. WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org