[ 
https://issues.apache.org/jira/browse/ODE-533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12697678#action_12697678
 ] 

Alexis Midon commented on ODE-533:
----------------------------------

In SoapExternalService, the invocation of the service happens in a thread taken 
out of the common thread pool. This invocation retrieves an HTTP connection 
from the connection pool.  Assuming the max number of connections is small, and 
that many invocations happen simultaneously, other threads (retrieved from the 
same pool) will be waiting for a connection. As invocations are piling up, 
threads are retrieved from the pool and wait for a connection. As a result the 
thread pool get starved, waiting for a thread to be released.
Here one could think that this is a regular thread pool starvation scenario and 
that once a thread will release a connection, a thread will get it, do its job 
and get back to the pool. Nothing more that jobs sequentialization.

But actually this case is different because while the service invocation 
happens in thread A, the release of the HTTP connection takes place in yet 
another thread, thread B. And guess where Thread B comes from? The exact same 
thread pool we just starved. So, the connection release never gets a chance to 
happen. => Engine locked.

The immediate to fix is to increase the size of the connection pool. Actually 
the connection pool size should be greater that the thread pool size. That's 
what r763815 does.

A better solution would be to eliminate the need for Thread B, and do the 
connection release in the thread A. ODE-577 tracks this.

> Share a connection manager across SoapExternalServices
> ------------------------------------------------------
>
>                 Key: ODE-533
>                 URL: https://issues.apache.org/jira/browse/ODE-533
>             Project: ODE
>          Issue Type: Improvement
>          Components: Axis2 Integration
>    Affects Versions: 1.1, 1.1.1, 1.2
>            Reporter: Alexis Midon
>            Assignee: Alexis Midon
>             Fix For: 1.3.1, 2.0
>
>
> All external service should share the same http connection manager. The 
> connection manager will be initialized by ODEServer. ExternalServices would 
> receive a ConfigurationContext instance containing this connection manager.
> Configuration of the connection manager will be done through 
> ode-axis2.properties :
> "http.connection-manager.max-per-host"
> "http.connection-manager.max-total"
> In addition, we should make sure axis2 release the connections to the pool. 
> By invoking OperationClient#complete.
> see http://markmail.org/thread/voabzcl6u2pck74n

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

Reply via email to