mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-16 23:16:33 +00:00
HTTPCLIENT-692: TSCCM throws InterruptedException
git-svn-id: https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpclient/trunk@578385 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5d5b2fa48d
commit
a9722d704e
@ -1,5 +1,8 @@
|
||||
Changes since release 4.0 Alpha 1
|
||||
|
||||
* [HTTPCLIENT-692] ClientConnectionManager throws InterruptedException
|
||||
Contributed by Roland Weber <rolandw at apache.org>
|
||||
|
||||
* [HTTPCORE-116] moved parameter names to interfaces
|
||||
Contributed by Roland Weber <rolandw at apache.org>
|
||||
|
||||
|
@ -156,11 +156,13 @@ protected AbstractConnPool(ClientConnectionManager mgr) {
|
||||
*
|
||||
* @throws ConnectionPoolTimeoutException
|
||||
* if the timeout expired
|
||||
* @throws InterruptedException
|
||||
* if the calling thread was interrupted
|
||||
*/
|
||||
public abstract
|
||||
BasicPoolEntry getEntry(HttpRoute route, long timeout,
|
||||
ClientConnectionOperator operator)
|
||||
throws ConnectionPoolTimeoutException
|
||||
throws ConnectionPoolTimeoutException, InterruptedException
|
||||
;
|
||||
|
||||
|
||||
|
@ -167,7 +167,7 @@ public synchronized int getConnectionsInPool(HttpRoute route) {
|
||||
public synchronized
|
||||
BasicPoolEntry getEntry(HttpRoute route, long timeout,
|
||||
ClientConnectionOperator operator)
|
||||
throws ConnectionPoolTimeoutException {
|
||||
throws ConnectionPoolTimeoutException, InterruptedException {
|
||||
|
||||
BasicPoolEntry entry = null;
|
||||
|
||||
@ -245,8 +245,7 @@ BasicPoolEntry getEntry(HttpRoute route, long timeout,
|
||||
} catch (InterruptedException e) {
|
||||
if (!waitingThread.interruptedByConnectionPool) {
|
||||
LOG.debug("Interrupted while waiting for connection.", e);
|
||||
throw new IllegalThreadStateException(
|
||||
"Interrupted while waiting in " + this);
|
||||
throw e;
|
||||
}
|
||||
// Else, do nothing, we were interrupted by the
|
||||
// connection pool and should now have a connection
|
||||
|
@ -141,19 +141,19 @@ public SchemeRegistry getSchemeRegistry() {
|
||||
|
||||
|
||||
// non-javadoc, see interface ClientConnectionManager
|
||||
public ManagedClientConnection getConnection(HttpRoute route) {
|
||||
public ManagedClientConnection getConnection(HttpRoute route)
|
||||
throws InterruptedException {
|
||||
|
||||
while (true) {
|
||||
try {
|
||||
return getConnection(route, 0);
|
||||
} catch (ConnectionPoolTimeoutException e) {
|
||||
// We'll go ahead and log this, but it should never happen.
|
||||
// Exceptions are only thrown when the timeout occurs and
|
||||
// since we have no timeout, it doesn't happen.
|
||||
LOG.debug(
|
||||
"Unexpected exception while waiting for connection",
|
||||
e
|
||||
);
|
||||
// These exceptions are only thrown when the timeout occurs
|
||||
// and since we have no timeout, it doesn't happen.
|
||||
LOG.debug
|
||||
("Unexpected exception while waiting for connection", e);
|
||||
//@@@ throw RuntimeException or Error to indicate the problem?
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -162,7 +162,7 @@ public ManagedClientConnection getConnection(HttpRoute route) {
|
||||
// non-javadoc, see interface ClientConnectionManager
|
||||
public ManagedClientConnection getConnection(HttpRoute route,
|
||||
long timeout)
|
||||
throws ConnectionPoolTimeoutException {
|
||||
throws ConnectionPoolTimeoutException, InterruptedException {
|
||||
|
||||
if (route == null) {
|
||||
throw new IllegalArgumentException("Route may not be null.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user