You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Jan Hallonsten (JIRA)" <ji...@apache.org> on 2018/10/22 15:30:00 UTC
[jira] [Created] (CXF-7881) HttpConduit.handleResponseOnWorkqueue
will always handle response on current thread when allowCurrentThread is
false and the work queue rejects the execution
Jan Hallonsten created CXF-7881:
-----------------------------------
Summary: HttpConduit.handleResponseOnWorkqueue will always handle response on current thread when allowCurrentThread is false and the work queue rejects the execution
Key: CXF-7881
URL: https://issues.apache.org/jira/browse/CXF-7881
Project: CXF
Issue Type: Bug
Components: Transports
Affects Versions: 3.2.6
Reporter: Jan Hallonsten
Creating this Jira according to the discussion [here|http://example.com/]
In the method
[org.apache.cxf.transport.http.HTTPConduit.handleResponseOnWorkqueue(boolean allowCurrentThread, boolean forceWQ)|https://github.com/apache/cxf/blob/540bb76f6f3d3d23944c566905f9f395c6f86b79/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java#L1190]
If the work queue is full so that RejectedExecutionException is thrown and allowCurrentThread is false like when called from [AsyncHttpConduit|https://github.com/apache/cxf/blob/6db38f9984b9c0bf6309a3d7e26d5a9ab8055d1f/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java#L600] the expression in the if statement below will always return false and the response will be handled on the current thread via the call to handleResponseInternal. When used from AsyncHttpConduit this will be the IO core thread which is not a good idea.
{code:java}
} catch (RejectedExecutionException rex) {
if (allowCurrentThread
&& policy != null
&& policy.isSetAsyncExecuteTimeoutRejection()
&& policy.isAsyncExecuteTimeoutRejection()) {
throw rex;
}
if (!hasLoggedAsyncWarning) {
LOG.warning("EXECUTOR_FULL_WARNING");
hasLoggedAsyncWarning = true;
}
LOG.fine("EXECUTOR_FULL");
handleResponseInternal();
}
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)