Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #2014 - Unix Socket Client #2025

Merged
merged 49 commits into from
Jan 13, 2018
Merged
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
fd61e8f
WIP add unix domain sockets support in HttpClient
olamy Dec 6, 2017
966640b
move unix socket client part to unix socket module #2014
olamy Dec 6, 2017
322cff6
some cleanup #2014
olamy Dec 6, 2017
9dccecc
add missing headers #2014
olamy Dec 6, 2017
9765b1c
add TODO
olamy Dec 6, 2017
088bcb6
UnixSocket client refactor
gregw Dec 6, 2017
eeb5b6d
cleanup test and pom
olamy Dec 6, 2017
79ab83f
minor changes, use LOG.isDebugEnabled() before using debug method
olamy Dec 6, 2017
994c507
add UNIX SOCKET http client test with all other tests, push this to s…
olamy Dec 7, 2017
b592dd1
fix some unit tests
olamy Dec 7, 2017
fad3952
fix more tests
olamy Dec 7, 2017
ef199d1
fix load test
olamy Dec 7, 2017
c2ac3bb
Merge branch 'feature/unix_socket_client' of https://github.com/olamy…
gregw Dec 7, 2017
af1aa63
UnixSocket client
gregw Dec 7, 2017
6e1983e
Merge branch 'jetty-9.4.x' into jetty-9.4.x-2014-unixsocket-client
gregw Dec 7, 2017
33ebd90
Demonstrate JNR bug
gregw Dec 7, 2017
1921220
Worked around JNR bug 50
gregw Dec 7, 2017
0b8fa17
Merge branch 'jetty-9.4.x' into jetty-9.4.x-2014-unixsocket-client
gregw Dec 25, 2017
f846b87
close channel on client side as well
olamy Dec 8, 2017
52a3b91
more details in log
olamy Dec 8, 2017
6a0ff1c
log file path as well
olamy Dec 8, 2017
8672f0e
#2014 disable test per default as doesn't work on some environement
olamy Dec 28, 2017
44ddc42
Merge pull request #2082 from olamy/jetty-9.4.x-2014-unixsocket-clien…
gregw Dec 28, 2017
27dc3a8
Merge branch 'jetty-9.4.x' into jetty-9.4.x-2014-unixsocket-client
gregw Dec 28, 2017
7530148
Revert "#2014 disable test per default as doesn't work on some enviro…
gregw Dec 28, 2017
d8f7d5c
test only on unix
gregw Dec 28, 2017
5929306
Allow test of specific transport(s)
gregw Dec 28, 2017
a81aec0
Move unix socket to /tmp
gregw Jan 2, 2018
eb592f7
move test socket to /tmp
gregw Jan 2, 2018
6ad955f
move test socket to /tmp
gregw Jan 2, 2018
fdadc8b
Merge branch 'jetty-9.4.x' into jetty-9.4.x-2014-unixsocket-client
gregw Jan 8, 2018
2f5cb23
ignore failing tests for now
gregw Jan 8, 2018
26e7e83
fix bean name and possible to use sys prop org.eclipse.jetty.http.cli…
olamy Jan 7, 2018
8169b71
test isBlank as surefire props is not null
olamy Jan 7, 2018
7b0217c
correctly create tmp file with @Before
olamy Jan 7, 2018
c20b32d
do not delete file
olamy Jan 8, 2018
01966c3
use /tmp as build directory doesn't seem to work within docker...
olamy Jan 8, 2018
5826fc6
do not delete sock file on client as it is own by the server
olamy Jan 8, 2018
fec0955
file must not exist when binding unix socket
olamy Jan 8, 2018
de43987
Merge pull request #2106 from olamy/jetty-9.4.x-2014-unixsocket-clien…
gregw Jan 9, 2018
6a3b4c3
Merge branch 'jetty-9.4.x' into jetty-9.4.x-2014-unixsocket-client
gregw Jan 10, 2018
5ad783f
#2014 fix license header
olamy Jan 10, 2018
e77a064
Merge pull request #2112 from olamy/jetty-9.4.x-2014-unixsocket-clien…
joakime Jan 10, 2018
3dfaf7b
Merge branch 'jetty-9.4.x' into jetty-9.4.x-2014-unixsocket-client
gregw Jan 11, 2018
f5020fe
network specific tests assumed
gregw Jan 11, 2018
503f2da
Fixed to handle null selector keys
gregw Jan 11, 2018
d606a6f
Merge branch 'jetty-9.4.x' into jetty-9.4.x-2014-unixsocket-client
gregw Jan 11, 2018
287e8fa
Merge branch 'jetty-9.4.x' into jetty-9.4.x-2014-unixsocket-client
gregw Jan 11, 2018
6fdfbdf
add assume for tests that assume a network connector
gregw Jan 12, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix some unit tests
Signed-off-by: olivier lamy <[email protected]>
olamy committed Dec 7, 2017
commit b592dd1c271c9be7b9423b715dd8037e52e5662f
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ public static Object[] parameters() throws Exception
return Transport.values();//new Transport[]{UNIX_SOCKET};// Transport.values();
}

private Path sockFile;
protected Path sockFile;

@Rule
public final TestTracker tracker = new TestTracker();
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.unixsocket.client.HttpClientTransportOverUnixSockets;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.LeakDetector;
import org.eclipse.jetty.util.log.Log;
@@ -117,6 +118,10 @@ protected void leaked(LeakDetector.LeakInfo leakInfo)
});
return clientTransport;
}
case UNIX_SOCKET:
{
return new HttpClientTransportOverUnixSockets( sockFile.toString() );
}
default:
{
return super.provideClientTransport(transport);
Original file line number Diff line number Diff line change
@@ -60,6 +60,7 @@
import org.eclipse.jetty.client.util.OutputStreamContentProvider;
import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
@@ -463,7 +464,8 @@ public void testInputStreamResponseListenerFailedBeforeResponse() throws Excepti

InputStreamResponseListener listener = new InputStreamResponseListener();
// Connect to the wrong port
client.newRequest(newURI())
client.newRequest("localhost",
(connector instanceof ServerConnector?ServerConnector.class.cast( connector ).getLocalPort():1))
.scheme(getScheme())
.send(listener);
Result result = listener.await(5, TimeUnit.SECONDS);
@@ -940,8 +942,8 @@ public void testUploadWithOutputStreamFailureToConnect() throws Exception
final byte[] data = new byte[512];
final CountDownLatch latch = new CountDownLatch(1);
OutputStreamContentProvider content = new OutputStreamContentProvider();
client.newRequest("0.0.0.1:"
+ ((connector instanceof ServerConnector)?ServerConnector.class.cast( connector ).getLocalPort():"0"))
client.newRequest("http://0.0.0.1"
+ ((connector instanceof ServerConnector)?":"+ServerConnector.class.cast(connector).getLocalPort():""))
.scheme(getScheme())
.content(content)
.send(result ->
@@ -1028,8 +1030,8 @@ public void close() throws IOException
InputStreamContentProvider content = new InputStreamContentProvider(stream);

final CountDownLatch completeLatch = new CountDownLatch(1);
client.newRequest("0.0.0.1:"
+ ((connector instanceof ServerConnector)?ServerConnector.class.cast( connector ).getLocalPort():"0"))
client.newRequest("http://0.0.0.1"
+ ((connector instanceof ServerConnector)?":"+ServerConnector.class.cast(connector).getLocalPort():""))
.scheme(getScheme())
.content(content)
.send(result ->