danny0405 commented on code in PR #19742:
URL: https://github.com/apache/hudi/pull/19742#discussion_r3859305532


##########
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/DynamoDBBasedLockProviderBase.java:
##########
@@ -150,9 +150,14 @@ public void close() {
         }
         lock = null;
       }
-      this.client.close();
     } catch (Exception e) {
       LOG.error(generateLogStatement(LockState.FAILED_TO_RELEASE, 
generateLogSuffixString()));
+    } finally {
+      try {
+        this.client.close();

Review Comment:
   Could we add focused regression coverage for this failure path? Please make 
`releaseLock()` throw, call `DynamoDBBasedLockProviderBase.close()`, and verify 
that `AmazonDynamoDBLockClient.close()` is still invoked (or directly verify 
that its heartbeat thread stops). The existing DynamoDB lock-provider tests do 
not exercise `close()`, so they would also pass with the original leaking 
implementation.



-- 
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]

Reply via email to