Jecarm commented on a change in pull request #2119:
URL: https://github.com/apache/iceberg/pull/2119#discussion_r563432492
##########
File path:
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveClientPool.java
##########
@@ -83,6 +83,20 @@ protected HiveMetaStoreClient reconnect(HiveMetaStoreClient
client) {
return client;
}
+ @Override
+ protected boolean failureDetection(HiveMetaStoreClient client, Exception ex)
{
Review comment:
I have submitted the new code. Please review it. @pvary @rdblue
##########
File path:
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveClientPool.java
##########
@@ -83,6 +84,15 @@ protected HiveMetaStoreClient reconnect(HiveMetaStoreClient
client) {
return client;
}
+ @Override
+ protected boolean failureDetection(Exception e) {
+ if (Objects.nonNull(e) && e instanceof MetaException &&
Review comment:
I would replace it with `e != null`
##########
File path: hive-metastore/src/main/java/org/apache/iceberg/hive/ClientPool.java
##########
@@ -54,7 +54,7 @@
return action.run(client);
} catch (Exception exc) {
- if (reconnectExc.isInstance(exc)) {
+ if (reconnectExc.isInstance(exc) || failureDetection(exc)) {
Review comment:
Yes, it can be done, but the constructor of `ClientPool` may change.
Because the members of `reconnectExc` will be deleted. Does this affect other
component calls?
##########
File path: hive-metastore/src/main/java/org/apache/iceberg/hive/ClientPool.java
##########
@@ -54,7 +54,7 @@
return action.run(client);
} catch (Exception exc) {
- if (reconnectExc.isInstance(exc)) {
+ if (reconnectExc.isInstance(exc) || failureDetection(exc)) {
Review comment:
Or just move reconnectExc.isInstance(exc) into the failureDetection(exc)
method in `ClientPool`, like this:
```
try {
return action.run(client);
} catch (Exception exc) {
if (failureDetection(exc)) {
...
}
}
protected boolean failureDetection(Exception exc) {
return reconnectExc.isInstance(exc);
}
```
@pvary
##########
File path: hive-metastore/src/main/java/org/apache/iceberg/hive/ClientPool.java
##########
@@ -54,7 +54,7 @@
return action.run(client);
} catch (Exception exc) {
- if (reconnectExc.isInstance(exc)) {
+ if (reconnectExc.isInstance(exc) || failureDetection(exc)) {
Review comment:
Okay.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]