You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mo...@apache.org on 2016/12/23 17:47:37 UTC
zeppelin git commit: [ZEPPELIN-1833] Fix bug in
ClientFactory.destroyObject that does not close socket connections
Repository: zeppelin
Updated Branches:
refs/heads/master 6808bdc69 -> b2d4c36dd
[ZEPPELIN-1833] Fix bug in ClientFactory.destroyObject that does not close socket connections
### What is this PR for?
Fix bug in ClientFactory.destroyObject that does not close socket connections
### What type of PR is it?
Bug Fix
### Todos
NA
### What is the Jira issue?
[ZEPPELIN-1833](https://issues.apache.org/jira/browse/ZEPPELIN-1833)
### How should this be tested?
* Create multiple paragraphs and execute them in parallel. This will create multiple thrift clients and active connections.
* When the clients are returned to the object pool, verify that the destroyObject correctly closes connections. Use the netstat command to get number of active connections.
### Screenshots (if appropriate)
NA
### Questions:
* Does the licenses files need update?
No
* Is there breaking changes for older versions?
No
* Does this needs documentation?
No
Author: Prasad Wagle <pw...@twitter.com>
Closes #1785 from prasadwagle/ZEPPELIN-1833 and squashes the following commits:
3e5ccd7 [Prasad Wagle] Use correct client hashmap key to close socket
Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/b2d4c36d
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/b2d4c36d
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/b2d4c36d
Branch: refs/heads/master
Commit: b2d4c36ddafa436ff42f4d137ae4e468fbde8f7e
Parents: 6808bdc
Author: Prasad Wagle <pw...@twitter.com>
Authored: Mon Dec 19 21:02:18 2016 -0800
Committer: Lee moon soo <mo...@apache.org>
Committed: Fri Dec 23 09:47:31 2016 -0800
----------------------------------------------------------------------
.../org/apache/zeppelin/interpreter/remote/ClientFactory.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/b2d4c36d/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/ClientFactory.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/ClientFactory.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/ClientFactory.java
index c980c47..b2cb78f 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/ClientFactory.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/ClientFactory.java
@@ -70,9 +70,9 @@ public class ClientFactory extends BasePooledObjectFactory<Client>{
@Override
public void destroyObject(PooledObject<Client> p) {
synchronized (clientSocketMap) {
- if (clientSocketMap.containsKey(p)) {
- clientSocketMap.get(p).close();
- clientSocketMap.remove(p);
+ if (clientSocketMap.containsKey(p.getObject())) {
+ clientSocketMap.get(p.getObject()).close();
+ clientSocketMap.remove(p.getObject());
}
}
}