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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]