@@ -3194,26 +3194,31 @@ private void cleanupOffloaded(long ledgerId, UUID uuid, String offloadDriverName
3194
3194
metadataMap .putAll (offloadDriverMetadata );
3195
3195
metadataMap .put ("ManagedLedgerName" , name );
3196
3196
3197
- config .getLedgerOffloader ()
3198
- .deleteOffloaded (ledgerId , uuid , metadataMap )
3199
- .whenComplete ((ignored , exception ) -> {
3200
- if (exception != null ) {
3201
- log .warn ("[{}] Error cleaning up offload for {}, (cleanup reason: {})" ,
3202
- name , ledgerId , cleanupReason , exception );
3203
- scheduledExecutor .schedule (
3204
- safeRun (() -> cleanupOffloaded (
3205
- ledgerId ,
3206
- uuid ,
3207
- offloadDriverName ,
3208
- offloadDriverMetadata ,
3209
- cleanupReason ,
3210
- retry - 1 ,
3211
- callback )),
3212
- DEFAULT_LEDGER_DELETE_BACKOFF_TIME_SEC , TimeUnit .SECONDS );
3213
- return ;
3214
- }
3215
- callback .deleteLedgerComplete (null );
3216
- });
3197
+ try {
3198
+ config .getLedgerOffloader ()
3199
+ .deleteOffloaded (ledgerId , uuid , metadataMap )
3200
+ .whenComplete ((ignored , exception ) -> {
3201
+ if (exception != null ) {
3202
+ log .warn ("[{}] Error cleaning up offload for {}, (cleanup reason: {})" ,
3203
+ name , ledgerId , cleanupReason , exception );
3204
+ scheduledExecutor .schedule (
3205
+ safeRun (() -> cleanupOffloaded (
3206
+ ledgerId ,
3207
+ uuid ,
3208
+ offloadDriverName ,
3209
+ offloadDriverMetadata ,
3210
+ cleanupReason ,
3211
+ retry - 1 ,
3212
+ callback )),
3213
+ DEFAULT_LEDGER_DELETE_BACKOFF_TIME_SEC , TimeUnit .SECONDS );
3214
+ return ;
3215
+ }
3216
+ callback .deleteLedgerComplete (null );
3217
+ });
3218
+ } catch (Exception nonretriableException ) {
3219
+ log .info ("[{}] Failed to delete offloaded ledger:{} under driver:{}" ,
3220
+ name , ledgerId , config .getLedgerOffloader ().getOffloadDriverName (), nonretriableException );
3221
+ }
3217
3222
}
3218
3223
3219
3224
/**
0 commit comments