frostruan commented on code in PR #5603:
URL: https://github.com/apache/hbase/pull/5603#discussion_r1442698886
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java:
##########
@@ -147,12 +152,16 @@ private TableDescriptor loadTableDescriptor() throws
IOException {
public TakeSnapshotHandler prepare() throws Exception {
super.prepare();
// after this, you should ensure to release this lock in case of exceptions
- this.tableLock.acquire();
- try {
- this.htd = loadTableDescriptor(); // check that .tableinfo is present
- } catch (Exception e) {
- this.tableLock.release();
- throw e;
+ if (this.tableLock.tryAcquire(this.lockAcquireTimeoutMs)) {
+ try {
+ this.htd = loadTableDescriptor(); // check that .tableinfo is present
+ } catch (Exception e) {
+ this.tableLock.release();
+ throw e;
+ }
+ } else {
+ LOG.error("Master lock could not be acquired in {} ms",
lockAcquireTimeoutMs);
+ throw new IOException("Master lock could not be acquired");
Review Comment:
I don't think retrying makes much sense in this scenario, so I would prefer
to throw a DoNotRetryIOException like HBaseSnapshotException or
SnapshotCreationException. What do you think ?
--
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]