You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2016/11/08 07:56:41 UTC
[1/7] cxf git commit: Fix read timeout when underlying Connection
Pool cannot provide a connection right away
Repository: cxf
Updated Branches:
refs/heads/master 4ca530b75 -> caac86161
Fix read timeout when underlying Connection Pool cannot provide a connection right away
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a857349e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a857349e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a857349e
Branch: refs/heads/master
Commit: a857349e851ee1aee9fa053e033473d5dae31e3c
Parents: 1ffd27f
Author: William Montaz <wm...@voyages-sncf.com>
Authored: Wed Nov 2 15:46:54 2016 +0100
Committer: William Montaz <wm...@voyages-sncf.com>
Committed: Wed Nov 2 15:46:54 2016 +0100
----------------------------------------------------------------------
.../cxf/transport/http/asyncclient/AsyncHTTPConduit.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/a857349e/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
old mode 100644
new mode 100755
index 0ebcb81..1234ba4
--- a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
+++ b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
@@ -471,6 +471,7 @@ public class AsyncHTTPConduit extends URLConnectionHTTPConduit {
outbuf.shutdown();
}
public void cancelled() {
+ handleCancelled();
inbuf.shutdown();
outbuf.shutdown();
}
@@ -610,12 +611,15 @@ public class AsyncHTTPConduit extends URLConnectionHTTPConduit {
}
notifyAll();
}
+ protected synchronized void handleCancelled(){
+ notifyAll();
+ }
protected synchronized HttpResponse getHttpResponse() throws IOException {
while (httpResponse == null) {
if (exception == null) { //already have an exception, skip waiting
try {
- wait(csPolicy.getReceiveTimeout());
+ wait();
} catch (InterruptedException e) {
throw new IOException(e);
}
[3/7] cxf git commit: Fix timeout handling by non async requests
Posted by ff...@apache.org.
Fix timeout handling by non async requests
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1c346599
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1c346599
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1c346599
Branch: refs/heads/master
Commit: 1c34659984b1c3a64463471166a4c772597c0ac8
Parents: db55b10
Author: William Montaz <wm...@voyages-sncf.com>
Authored: Thu Nov 3 15:03:52 2016 +0100
Committer: William Montaz <wm...@voyages-sncf.com>
Committed: Thu Nov 3 15:03:52 2016 +0100
----------------------------------------------------------------------
.../cxf/transport/http/asyncclient/AsyncHTTPConduit.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/1c346599/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
index 72c6ebf..76f333b 100755
--- a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
+++ b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
@@ -619,7 +619,11 @@ public class AsyncHTTPConduit extends URLConnectionHTTPConduit {
while (httpResponse == null) {
if (exception == null) { //already have an exception, skip waiting
try {
- wait();
+ if (isAsync) {
+ wait();
+ } else {
+ wait(csPolicy.getReceiveTimeout());
+ }
} catch (InterruptedException e) {
throw new IOException(e);
}
[6/7] cxf git commit: Merge branch 'fix-AsyncHTTPConduit-timeout' of
https://github.com/Willymontaz/cxf
Posted by ff...@apache.org.
Merge branch 'fix-AsyncHTTPConduit-timeout' of https://github.com/Willymontaz/cxf
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e55ea144
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e55ea144
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e55ea144
Branch: refs/heads/master
Commit: e55ea144c95f81ecfac420289af9684438f27e87
Parents: 4ca530b 44a697f
Author: Freeman Fang <fr...@gmail.com>
Authored: Tue Nov 8 09:37:58 2016 +0800
Committer: Freeman Fang <fr...@gmail.com>
Committed: Tue Nov 8 09:37:58 2016 +0800
----------------------------------------------------------------------
.../transport/http/asyncclient/AsyncHTTPConduit.java | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[4/7] cxf git commit: Fix socket timeout and connection request
timeout from AsyncHTTPClient
Posted by ff...@apache.org.
Fix socket timeout and connection request timeout from AsyncHTTPClient
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4c6a9aaf
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4c6a9aaf
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4c6a9aaf
Branch: refs/heads/master
Commit: 4c6a9aaf61b5651d4fe0bb077e052bcd5196be71
Parents: 1c34659
Author: William Montaz <wm...@voyages-sncf.com>
Authored: Mon Nov 7 11:04:20 2016 +0100
Committer: William Montaz <wm...@voyages-sncf.com>
Committed: Mon Nov 7 11:04:20 2016 +0100
----------------------------------------------------------------------
.../transport/http/asyncclient/AsyncHTTPConduit.java | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/4c6a9aaf/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
index 76f333b..7123ee9 100755
--- a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
+++ b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
@@ -220,7 +220,9 @@ public class AsyncHTTPConduit extends URLConnectionHTTPConduit {
e.setEntity(entity);
RequestConfig.Builder b = RequestConfig.custom()
- .setConnectTimeout((int) csPolicy.getConnectionTimeout());
+ .setConnectTimeout((int) csPolicy.getConnectionTimeout())
+ .setSocketTimeout((int) csPolicy.getReceiveTimeout())
+ .setConnectionRequestTimeout((int) csPolicy.getReceiveTimeout());
Proxy p = proxyFactory.createProxy(csPolicy, uri);
if (p != null && p.type() != Proxy.Type.DIRECT) {
InetSocketAddress isa = (InetSocketAddress)p.address();
@@ -619,11 +621,7 @@ public class AsyncHTTPConduit extends URLConnectionHTTPConduit {
while (httpResponse == null) {
if (exception == null) { //already have an exception, skip waiting
try {
- if (isAsync) {
- wait();
- } else {
- wait(csPolicy.getReceiveTimeout());
- }
+ wait();
} catch (InterruptedException e) {
throw new IOException(e);
}
@@ -652,7 +650,7 @@ public class AsyncHTTPConduit extends URLConnectionHTTPConduit {
protected void handleResponseAsync() throws IOException {
isAsync = true;
- factory.timer.schedule(new CheckReceiveTimeoutForAsync(), csPolicy.getReceiveTimeout());
+// factory.timer.schedule(new CheckReceiveTimeoutForAsync(), csPolicy.getReceiveTimeout());
}
protected void closeInputStream() throws IOException {
[7/7] cxf git commit: [CXF-7122]remove unnecessary Timer
Posted by ff...@apache.org.
[CXF-7122]remove unnecessary Timer
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/caac8616
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/caac8616
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/caac8616
Branch: refs/heads/master
Commit: caac861613b4df07eb3ff4023e1b9e53b07cd5ea
Parents: e55ea14
Author: Freeman Fang <fr...@gmail.com>
Authored: Tue Nov 8 15:56:18 2016 +0800
Committer: Freeman Fang <fr...@gmail.com>
Committed: Tue Nov 8 15:56:18 2016 +0800
----------------------------------------------------------------------
.../http/asyncclient/AsyncHTTPConduit.java | 25 --------------------
.../asyncclient/AsyncHTTPConduitFactory.java | 3 +--
.../http/asyncclient/SharedOutputBuffer.java | 1 -
3 files changed, 1 insertion(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/caac8616/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
index 7123ee9..4b4b934 100755
--- a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
+++ b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
@@ -38,7 +38,6 @@ import java.security.cert.Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import java.util.TimerTask;
import java.util.concurrent.Future;
import java.util.logging.Level;
@@ -53,13 +52,11 @@ import org.apache.cxf.Bus;
import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.configuration.jsse.SSLUtils;
import org.apache.cxf.configuration.jsse.TLSClientParameters;
-import org.apache.cxf.endpoint.ClientCallback;
import org.apache.cxf.helpers.HttpHeaderHelper;
import org.apache.cxf.helpers.IOUtils;
import org.apache.cxf.io.CacheAndWriteOutputStream;
import org.apache.cxf.io.CachedOutputStream;
import org.apache.cxf.io.CopyingOutputStream;
-import org.apache.cxf.message.Exchange;
import org.apache.cxf.message.Message;
import org.apache.cxf.message.MessageUtils;
import org.apache.cxf.service.model.EndpointInfo;
@@ -650,7 +647,6 @@ public class AsyncHTTPConduit extends URLConnectionHTTPConduit {
protected void handleResponseAsync() throws IOException {
isAsync = true;
-// factory.timer.schedule(new CheckReceiveTimeoutForAsync(), csPolicy.getReceiveTimeout());
}
protected void closeInputStream() throws IOException {
@@ -867,29 +863,8 @@ public class AsyncHTTPConduit extends URLConnectionHTTPConduit {
}
}
- class CheckReceiveTimeoutForAsync extends TimerTask {
- public void run() {
-
- if (httpResponse == null) {
- outbuf.shutdown();
- inbuf.shutdown();
- if (exception != null) {
- throw new RuntimeException(exception);
- }
-
- Exchange exchange = outMessage.getExchange();
- // remove callback so that it won't be invoked twice
- ClientCallback cc = exchange.remove(ClientCallback.class);
- if (cc != null) {
- cc.handleException(null, new SocketTimeoutException());
- }
- }
- }
- }
-
}
-
public synchronized SSLContext getSSLContext(TLSClientParameters tlsClientParameters)
throws GeneralSecurityException {
http://git-wip-us.apache.org/repos/asf/cxf/blob/caac8616/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
index d4ac6b1..ba0c2ea 100644
--- a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
+++ b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
@@ -21,7 +21,6 @@ package org.apache.cxf.transport.http.asyncclient;
import java.io.IOException;
import java.util.Map;
-import java.util.Timer;
import java.util.concurrent.TimeUnit;
import org.apache.cxf.Bus;
@@ -132,7 +131,7 @@ public class AsyncHTTPConduitFactory implements HTTPConduitFactory {
int soTimeout = IOReactorConfig.DEFAULT.getSoTimeout();
boolean soKeepalive = IOReactorConfig.DEFAULT.isSoKeepalive();
boolean tcpNoDelay = true;
- Timer timer = new Timer();
+
AsyncHTTPConduitFactory() {
super();
http://git-wip-us.apache.org/repos/asf/cxf/blob/caac8616/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/SharedOutputBuffer.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/SharedOutputBuffer.java b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/SharedOutputBuffer.java
index 49cb9d6..1e3ed96 100644
--- a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/SharedOutputBuffer.java
+++ b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/SharedOutputBuffer.java
@@ -118,7 +118,6 @@ public class SharedOutputBuffer extends ExpandableBuffer {
public int produceContent(final ContentEncoder encoder, final IOControl ioc) throws IOException {
if (this.shutdown) {
- encoder.complete();
return -1;
}
this.lock.lock();
[5/7] cxf git commit: Merge branch 'master' of
https://github.com/apache/cxf into fix-AsyncHTTPConduit-timeout
Posted by ff...@apache.org.
Merge branch 'master' of https://github.com/apache/cxf into fix-AsyncHTTPConduit-timeout
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/44a697f2
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/44a697f2
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/44a697f2
Branch: refs/heads/master
Commit: 44a697f2cc343a65809e1f1e253a37d747698909
Parents: 4c6a9aa 9e1ba10
Author: William Montaz <wm...@voyages-sncf.com>
Authored: Mon Nov 7 11:04:57 2016 +0100
Committer: William Montaz <wm...@voyages-sncf.com>
Committed: Mon Nov 7 11:04:57 2016 +0100
----------------------------------------------------------------------
.../apache/cxf/common/util/PackageUtils.java | 30 ++++++++--------
.../cxf/common/util/PackageUtilsTest.java | 16 +++++++++
.../apache/cxf/ext/logging/osgi/Activator.java | 37 ++++++++++++--------
.../cxf/jaxrs/impl/AsyncResponseImpl.java | 2 +-
.../apache/cxf/jaxrs/utils/ResourceUtils.java | 19 +++++-----
.../http/asyncclient/SharedOutputBuffer.java | 1 +
.../transport/http_jetty/JettyHTTPHandler.java | 19 ++++++----
.../apache/cxf/transport/http/HTTPConduit.java | 1 +
.../jaxrs/JAXRSClientServerBookTest.java | 8 +++++
9 files changed, 89 insertions(+), 44 deletions(-)
----------------------------------------------------------------------
[2/7] cxf git commit: Fix code formatting
Posted by ff...@apache.org.
Fix code formatting
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/db55b103
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/db55b103
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/db55b103
Branch: refs/heads/master
Commit: db55b103124617476fe817b1e398142eb7ee43a6
Parents: a857349
Author: William Montaz <wm...@voyages-sncf.com>
Authored: Wed Nov 2 18:03:14 2016 +0100
Committer: William Montaz <wm...@voyages-sncf.com>
Committed: Wed Nov 2 18:03:14 2016 +0100
----------------------------------------------------------------------
.../apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/db55b103/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
index 1234ba4..72c6ebf 100755
--- a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
+++ b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
@@ -611,7 +611,7 @@ public class AsyncHTTPConduit extends URLConnectionHTTPConduit {
}
notifyAll();
}
- protected synchronized void handleCancelled(){
+ protected synchronized void handleCancelled() {
notifyAll();
}