You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "nadir amra (JIRA)" <ax...@ws.apache.org> on 2007/02/18 22:28:06 UTC

[jira] Created: (AXISCPP-1021) Connections not being closed - resulting in unused connections over time

Connections not being closed - resulting in unused connections over time
------------------------------------------------------------------------

                 Key: AXISCPP-1021
                 URL: https://issues.apache.org/jira/browse/AXISCPP-1021
             Project: Axis-C++
          Issue Type: Bug
          Components: Transport (axis3)
            Reporter: nadir amra
         Assigned To: nadir amra


Axis not fully closing connections after successful WS call (increase in number of unused connections over time).



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Closed: (AXISCPP-1021) Connections not being closed - resulting in unused connections over time

Posted by "nadir amra (JIRA)" <ax...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/AXISCPP-1021?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nadir amra closed AXISCPP-1021.
-------------------------------

       Resolution: Fixed
    Fix Version/s: current (nightly)

Resolved. Nothing is easy :-)

The soap transport interface was changed:

     /**
      * @brief Closes the connection established with OpenConnection.
+     * @param forceClose whether or not to force a close. If true, 
+     *        the connection will be closed.  If false, the transport
+     *        will determine whether connection should be closed based
+     *        on transport dependent properties.  For example, 
+     *        HTTP transport may use HTTP header "Connection: close"
+     *        to determine if connection should be closed.
      * @example AxisTransport.h
      */
-    virtual void closeConnection()=0;
+    virtual void closeConnection(bool forceClose=true)=0;

The HTTPTransport's closeConnection now has close logic:

 void HTTPTransport::
-closeConnection()
+closeConnection(bool forceClose)
 {
     resetInputStateMachine();

+    
+    // We will close the connection if forced close, or if "Connection: close" 
+    // header was detected.
+    if (forceClose || m_bReopenConnection)
+    {
+        m_bReopenConnection = false;
+        m_pActiveChannel->close();
+    }
 }



If you want to ensure that connections are closed on each invocation, then one can invoke stub method setTransportProperty.  For example:

ws.setTransportProperty("Connection", "close");

This will ensure that when web service method has completed, the call to Call::unInitialize() will call the transport's closeConnection method which will see that the property has been set and close the connection.  

Since the transport's closeConnection method now actually has the logic to close connections, it will do so if it needs to or if a force close was issued, which is a new method on the Call class, closeTransportConnection()...which does a forced close on the active channel.  Note that Call::unInitialize does not do a forced close, it leaves it up to closeConnection() to determine whether to close connection or not.  This is the default. 

I also updated ConnectionClose unit test to test setting the transport property.  

Things look good. 

> Connections not being closed - resulting in unused connections over time
> ------------------------------------------------------------------------
>
>                 Key: AXISCPP-1021
>                 URL: https://issues.apache.org/jira/browse/AXISCPP-1021
>             Project: Axis-C++
>          Issue Type: Bug
>          Components: Transport (axis3)
>            Reporter: nadir amra
>         Assigned To: nadir amra
>             Fix For: current (nightly)
>
>
> Axis not fully closing connections after successful WS call (increase in number of unused connections over time).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org