You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Daniel David Schäfer (JIRA)" <ax...@ws.apache.org> on 2005/04/21 15:05:46 UTC

[jira] Created: (AXIS-1945) Timeout-Handling

Timeout-Handling
----------------

         Key: AXIS-1945
         URL: http://issues.apache.org/jira/browse/AXIS-1945
     Project: Axis
        Type: Improvement
  Components: Basic Architecture  
    Versions: 1.2RC3    
    Reporter: Daniel David Schäfer
    Priority: Minor


Hi all,

I want to suggest a way to improve the default timeout-handling of apache axis for java.
A few days ago a firewall change lead to connection-timouts that took 10 minutes until
they threw their IOExceptions. This behaviour ate up all my rare tomcat threads. 
I was wandering about the 10 minutes because I always take care that my url-connections
abort after 10 to 40 seconds by setting the system-property  "sun.net.client.defaultConnectTimeout".

When I looked at the source-code of axis I found out where the 10 minutes come from.
This might be ok for most scenarios but not for the heavy load my system has to cope with 
every day.

So I patched the class org.apache.axis.client.Stub with the code below. 
It takes the value of the system-property sun.net.client.defaultConnectTimeout if it is
available and leaves everything else as it is.

If you want, feel free to use it in the official code.
For me it works fine.

bye

Daniel

===================================================================
RCS file: /usr/local/cvsroot/dev_projects/axis12/src/org/apache/axis/client/Stub.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- dev_projects/axis12/src/org/apache/axis/client/Stub.java	2005/04/21 09:05:21	1.1
+++ dev_projects/axis12/src/org/apache/axis/client/Stub.java	2005/04/21 09:31:05	1.2
@@ -50,7 +50,7 @@
     protected String     cachedUsername     = null;
     protected String     cachedPassword     = null;
     protected URL        cachedEndpoint     = null;
-    protected Integer    cachedTimeout      = null;
+    protected Integer    cachedTimeout      = getDefaultTimeout();
     protected QName      cachedPortName     = null;
 
     // Support for Header
@@ -73,6 +73,26 @@
         return ret;
     } // firstCall
 
+	/**
+	 *
+	 */
+	private static Integer getDefaultTimeout()
+	{
+		if(System.getProperty("sun.net.client.defaultConnectTimeout") != null)
+		{
+			try
+			{
+				return new Integer(System.getProperty("sun.net.client.defaultConnectTimeout"));
+			}
+			catch(NumberFormatException e)
+			{
+				;
+			}
+		}
+		
+		return null;
+	}
+	
     /**
      * Sets the value for a named property. JAX-RPC 1.0 specification 
      * specifies a standard set of properties that may be passed 



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (AXIS-1945) Timeout-Handling

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1945?page=all ]
     
Davanum Srinivas resolved AXIS-1945:
------------------------------------

    Resolution: Won't Fix

Please see latest CommonsHTTPSender stuff. it has some properties for setting the timeout.

http://marc.theaimsgroup.com/?l=axis-dev&m=111408376213000&w=2

thanks,
dims

> Timeout-Handling
> ----------------
>
>          Key: AXIS-1945
>          URL: http://issues.apache.org/jira/browse/AXIS-1945
>      Project: Axis
>         Type: Improvement
>   Components: Basic Architecture
>     Versions: 1.2RC3
>     Reporter: Daniel David Schäfer
>     Priority: Minor

>
> Hi all,
> I want to suggest a way to improve the default timeout-handling of apache axis for java.
> A few days ago a firewall change lead to connection-timouts that took 10 minutes until
> they threw their IOExceptions. This behaviour ate up all my rare tomcat threads. 
> I was wandering about the 10 minutes because I always take care that my url-connections
> abort after 10 to 40 seconds by setting the system-property  "sun.net.client.defaultConnectTimeout".
> When I looked at the source-code of axis I found out where the 10 minutes come from.
> This might be ok for most scenarios but not for the heavy load my system has to cope with 
> every day.
> So I patched the class org.apache.axis.client.Stub with the code below. 
> It takes the value of the system-property sun.net.client.defaultConnectTimeout if it is
> available and leaves everything else as it is.
> If you want, feel free to use it in the official code.
> For me it works fine.
> bye
> Daniel
> ===================================================================
> RCS file: /usr/local/cvsroot/dev_projects/axis12/src/org/apache/axis/client/Stub.java,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -r1.1 -r1.2
> --- dev_projects/axis12/src/org/apache/axis/client/Stub.java	2005/04/21 09:05:21	1.1
> +++ dev_projects/axis12/src/org/apache/axis/client/Stub.java	2005/04/21 09:31:05	1.2
> @@ -50,7 +50,7 @@
>      protected String     cachedUsername     = null;
>      protected String     cachedPassword     = null;
>      protected URL        cachedEndpoint     = null;
> -    protected Integer    cachedTimeout      = null;
> +    protected Integer    cachedTimeout      = getDefaultTimeout();
>      protected QName      cachedPortName     = null;
>  
>      // Support for Header
> @@ -73,6 +73,26 @@
>          return ret;
>      } // firstCall
>  
> +	/**
> +	 *
> +	 */
> +	private static Integer getDefaultTimeout()
> +	{
> +		if(System.getProperty("sun.net.client.defaultConnectTimeout") != null)
> +		{
> +			try
> +			{
> +				return new Integer(System.getProperty("sun.net.client.defaultConnectTimeout"));
> +			}
> +			catch(NumberFormatException e)
> +			{
> +				;
> +			}
> +		}
> +		
> +		return null;
> +	}
> +	
>      /**
>       * Sets the value for a named property. JAX-RPC 1.0 specification 
>       * specifies a standard set of properties that may be passed 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira