wombatu-kun opened a new pull request, #19371:
URL: https://github.com/apache/hudi/pull/19371

   ### Describe the issue this Pull Request addresses
   
   Closes #19345, point 1. Point 2 of that issue is addressed by #19370.
   
   ### Summary and Changelog
   
   An acquire that times out now reports the timeout instead of a misleading 
`NoSuchLockException`.
   
   - Removed the `catch (InterruptedException | TimeoutException e)` block from 
`HiveMetastoreBasedLockProvider.acquireLockInternal`. Both exceptions are 
already declared by the method, so they propagate and `tryLock` wraps the 
actual `TimeoutException`.
   - Collapsed the hoisted `lockRequest` local and its `lockRequestFinal` copy 
into one final local, since they only existed to feed `checkLock` after the 
`try` block.
   - Added `TestHiveMetastoreBasedLockProviderAcquireTimeout` with a mocked 
`IMetaStoreClient`: a blocked `lock()` call must fail with 
`HoodieLockException` caused by `TimeoutException` and must not call 
`checkLock`, and a WAITING lock must still be released. The first test fails 
without this change, with a bare `NullPointerException`.
   
   ### Impact
   
   `HoodieLockException` on an acquire timeout is now caused by 
`TimeoutException` rather than `NoSuchLockException`. No API or configuration 
change.
   
   ### Risk Level
   
   low
   
   The removed code could not execute against a real metastore, so no working 
behaviour is taken away.
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable
   


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