Description
XceiverClientManager doesn't close client on eviction which can leak resources.
public XceiverClientManager(Configuration conf) { . . . public void onRemoval( RemovalNotification<String, XceiverClientWithAccessInfo> removalNotification) { // If the reference count is not 0, this xceiver client should not // be evicted, add it back to the cache. WithAccessInfo info = removalNotification.getValue(); if (info.hasRefence()) { synchronized (XceiverClientManager.this.openClient) { XceiverClientManager.this .openClient.put(removalNotification.getKey(), info); } }
Also a stack overflow can be triggered because of putting the element back in the cache on eviction.
synchronized (XceiverClientManager.this.openClient) { XceiverClientManager.this .openClient.put(removalNotification.getKey(), info); }
This bug will try to fix both of these cases.