-
Notifications
You must be signed in to change notification settings - Fork 2.8k
ZEPPELIN-534 Discard broken thrift Client instance #575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* We can treat client as broken when TException occurs Conflicts: zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreter.java
a84d0eb to
22724cf
Compare
|
Thanks for the improvement. What do you think about overriding validateObject() in ClientFactory.java? for example I'm not 100% sure if it is identical to this PR. but if it is, this could be more simple. |
|
@Leemoonsoo If TTransport.isOpen() is similar to Socket's behavior, TTransport.isOpen() can't ensure that connection is still valid. We need to ping to remote to make it clear that connection is valid. Also, we should take care of setting of GenericObjectPoolConfig. Would it better to apply "ping" to this PR and apply validation modes? |
|
Though it works like charm, Jedis don't recommend users to use testOnBorrow and handle that thing manually since it reduces performance. Btw, I don't think it applies to Zeppelin since count of RPC call is relatively small. Maybe it would be possible to apply testOnBorrow. |
While we can not sure about it, this PR as it is looks good to me. Thanks for explanation. |
|
@Leemoonsoo |
|
I'm merging it if there're no more discussions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this is intended behaviour? I think it makes Zeppelin server stopped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually releaseClient() also has this issue since clientPool.returnObject() can throw similar kind of runtime exceptions.
Just difference between returnObject() and invalidateObject() is that invalidateObject() throws checked exception, too.
If we want to release client quietly (consume any exceptions), I can address to releaseClient() and releaseBrokenClient().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it does not have side effects, i think consuming exception (and log error) could be more safe.
|
@jongyoul @Leemoonsoo Address your comment. |
|
@HeartSaVioR Thanks! LGTM |
|
Looks great to me, @HeartSaVioR thank you for the improvement. |
|
Merging if there is no further discussion. |
What is this PR for?
Zeppelin has been reused broken thrift client instances.
Since we can catch TException, we can discard client instances which throws TException from client pool.
What type of PR is it?
Bug Fix | Improvement
Todos
Is there a relevant Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-534
How should this be tested?
output of 3
output of 4
Result could be different how many clients instances pool makes at initial phase.
Before applying this, output of 4 would be
broken pipe, which means it doesn't discard previous client instance.Screenshots (if appropriate)
Questions: