HBASE-25743: Retry REQUESTTIMEOUT based KeeperExceptions in ZK client.#3131
HBASE-25743: Retry REQUESTTIMEOUT based KeeperExceptions in ZK client.#3131bharathv merged 1 commit intoapache:masterfrom
Conversation
Starting ZOOKEEPER-2251, client requests exceeding a timeout can throw a KeeperException with REQUESTTIMEOUT opcode set. RecoverableZookeeper doesn't transparently retry in such cases.
| retryOrThrow(retryCounter, e, "delete"); | ||
| break; | ||
| case OPERATIONTIMEOUT: | ||
| case REQUESTTIMEOUT: |
There was a problem hiding this comment.
can we add a test case for this change ?
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
saintstack
left a comment
There was a problem hiding this comment.
LGTM
IMO @shahrs87, this would be hard to test. We would have to manufacture zk behaviors in our context. Do you have a suggestion?
@saintstack Is it possible to mock RecoverableZookeeper for first time to throw REQUESTTIMEOUT exception and second time it succeeds and verify the client call succeeded ? |
|
🎊 +1 overall
This message was automatically generated. |
|
Or subclass so could override the creation of the zk instance.... But we'd just be testing that retry 'works'? That the case catches the new enum, REQUESTTIMEOUT (which is from zk). I love tests. Just not sure it would add much in this case. Thanks @shahrs87 |
|
@saintstack I don't have any strong opinion in this case. If you feel this patch is good, then I am +1 |
|
It looks like a lot of code refactoring is needed to subclass and test and mocking seems to be complex since there are no setters for internal class state that doesn't seem worth refactoring. Skipping the test for now as discussed. Thanks for the reviews. |
virajjasani
left a comment
There was a problem hiding this comment.
Belated +1, nice one @bharathv
Starting ZOOKEEPER-2251, client requests exceeding a timeout can throw
a KeeperException with REQUESTTIMEOUT opcode set. RecoverableZookeeper
doesn't transparently retry in such cases.