You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "Marco Battaglia (JIRA)" <ji...@apache.org> on 2016/07/06 14:31:11 UTC
[jira] [Updated] (KNOX-720) Sockets remain in CLOSE_WAIT using
org.apache.hadoop.gateway.shell.Hadoop
[ https://issues.apache.org/jira/browse/KNOX-720?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marco Battaglia updated KNOX-720:
---------------------------------
Description:
The class org.apache.hadoop.gateway.shell.Hadoop used to connect to knox doesn't close opened socket.
The "shutdown" method of org...shell.Hadoop doesn't call client.close() and this produces too much permanent CLOSE_WAIT sockest.
Suggestion:
public void shutdown() throws InterruptedException {
- executor.shutdown();
+ closeClient();
}
public boolean shutdown( long timeout, TimeUnit unit ) throws InterruptedException {
- executor.shutdown();
+ closeClient();
return executor.awaitTermination( timeout, unit );
}
+
+ private void closeClient(){
+ executor.shutdownNow();
+ if(client!=null){
+ client.close();
+ }
+ }
was:
The class org.apache.hadoop.gateway.shell.Hadoop used to connect to knox doesn't close opened socket.
The "shutdown" method of org...shell.Hadoop doesn't call client.close() and this produces too much permanent CLOSE_WAIT sockest.
Suggestion:
public void shutdown() throws InterruptedException {
-
+ closeClient();
}
public boolean shutdown( long timeout, TimeUnit unit ) throws InterruptedException {
- executor.shutdown();
+ closeClient();
return executor.awaitTermination( timeout, unit );
}
+
+ private void closeClient(){
+ executor.shutdownNow();
+ if(client!=null){
+ client.close();
+ }
+ }
> Sockets remain in CLOSE_WAIT using org.apache.hadoop.gateway.shell.Hadoop
> -------------------------------------------------------------------------
>
> Key: KNOX-720
> URL: https://issues.apache.org/jira/browse/KNOX-720
> Project: Apache Knox
> Issue Type: Bug
> Components: ClientDSL
> Affects Versions: 0.7.0
> Reporter: Marco Battaglia
>
> The class org.apache.hadoop.gateway.shell.Hadoop used to connect to knox doesn't close opened socket.
> The "shutdown" method of org...shell.Hadoop doesn't call client.close() and this produces too much permanent CLOSE_WAIT sockest.
> Suggestion:
> public void shutdown() throws InterruptedException {
> - executor.shutdown();
> + closeClient();
> }
>
> public boolean shutdown( long timeout, TimeUnit unit ) throws InterruptedException {
> - executor.shutdown();
> + closeClient();
> return executor.awaitTermination( timeout, unit );
> }
> +
> + private void closeClient(){
> + executor.shutdownNow();
> + if(client!=null){
> + client.close();
> + }
> + }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)