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

JNR/UnixSocket connect does not release? #7187

Closed
mjs8002 opened this issue Dec 1, 2021 · 7 comments
Closed

JNR/UnixSocket connect does not release? #7187

mjs8002 opened this issue Dec 1, 2021 · 7 comments
Labels
Bug For general bugs on Jetty side Stale For auto-closed stale issues and pull requests

Comments

@mjs8002
Copy link

mjs8002 commented Dec 1, 2021

Jetty version(s)
9.4.43.v20210629
Java version/vendor (use: java -version)
1.8
OS type/version
linux
Description
Do not report security issues here! See Jetty Security Reports.
we use HttpClientTransportOverUnixSockets
send request such as :
HttpClientTransportOverUnixSockets transport = new HttpClientTransportOverUnixSockets(getSocketPath());
clientUds = new HttpClient(transport, null);
transport.setHttpClient(clientUds);
send:
...
request = client.newRequest(servicePath);
...
FutureResponseListener listener = new FutureResponseListener(request, bodysize);
request.send(listener);
ContentResponse response = listener.get(timeout, TimeUnit.MILLISECONDS);
Map<String, String> rspMap = new HashMap<String, String>();
rspMap.put("contentEncoding", response.getEncoding());
rspMap.put("contentType", response.getMediaType());
rspMap.put("streamAsString", response.getContentAsString());
return buildRestfulResponse(response.getStatus(), response.getHeaders(), response.getContent(), rspMap);
however we find in HttpDestination we debug :
20211201-150806(WeLinkPC)
in the connectionpool connect timeout but canot ralease when the pool is fulled we canot send any request

How to reproduce?

@mjs8002 mjs8002 added the Bug For general bugs on Jetty side label Dec 1, 2021
@mjs8002
Copy link
Author

mjs8002 commented Dec 1, 2021

image

we find the warn in log

@sbordet
Copy link
Contributor

sbordet commented Dec 1, 2021

Support for Unix-Domain sockets via jetty-unixsocket and related modules is experimental and deprecated (see #7109).

I recommend that you switch to Java 16 or later and use OpenJDK Unix-Domain support, which is supported in Jetty 10 via the jetty-unixdomain modules.

@joakime
Copy link
Contributor

joakime commented Dec 1, 2021

@sbordet what's the OpenJDK Unix-Domain replacement for HttpClient's HttpClientTransportOverUnixSockets?

@joakime joakime changed the title connect canot release JNR/UnixSocket connect does not release? Dec 1, 2021
@mjs8002
Copy link
Author

mjs8002 commented Dec 2, 2021

Support for Unix-Domain sockets via jetty-unixsocket and related modules is experimental and deprecated (see #7109).

I recommend that you switch to Java 16 or later and use OpenJDK Unix-Domain support, which is supported in Jetty 10 via the jetty-unixdomain modules.

@sbordet Is there a good solution on jetty 9?

@sbordet
Copy link
Contributor

sbordet commented Dec 2, 2021

Unfortunately no, JNR is not stable enough and now that support for Unix-Domain landed in the JDK I don't think we will try and chase down bugs in JNR.

Note that using Jetty 10's HttpClient is probably just a drop in replacement for Jetty 9's HttpClient, so I recommend that you upgrade - you will probably have to change very little in your client application.

@github-actions
Copy link

github-actions bot commented Dec 3, 2022

This issue has been automatically marked as stale because it has been a
full year without activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@github-actions github-actions bot added the Stale For auto-closed stale issues and pull requests label Dec 3, 2022
@github-actions
Copy link

github-actions bot commented Jan 2, 2023

This issue has been closed due to it having no activity.

@github-actions github-actions bot closed this as completed Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side Stale For auto-closed stale issues and pull requests
Projects
None yet
Development

No branches or pull requests

3 participants