| Summary: | jetty client socket fd leak when access an URL with bad domain | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [RT] Jetty | Reporter: | Junwei Sun <sunjunwei2> | ||||||||
| Component: | client | Assignee: | Jesse McConnell <jesse.mcconnell> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | critical | ||||||||||
| Priority: | P3 | CC: | gregw, janb, jesse.mcconnell, jetty-inbox | ||||||||
| Version: | unspecified | ||||||||||
| Target Milestone: | 7.5.x | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Linux | ||||||||||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=358959 | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Junwei Sun
Created attachment 203644 [details]
simple test
oops this attachment was for 346419, which looks to be very similar. Created attachment 203647 [details]
proposed patch
Created attachment 203648 [details]
proposed patch
Hi Simone, Greg,
please find attached two patch files. The first commit is only a codeformat and the second catches the Exception, closes the connection and rethrows the RuntimeException.
Cheers,
Thomas
Hi Thomas, Thanks for the fast reply. I've reviewed the code that handles one exception "UnresolvedAddressException". Actually, there are two exceptions, another one is "UnknownHostException" when I have code "httpclient.setConnectBlocking(true)". I think we need to handle all of these exceptions to avoid fd leak. Regards, Junwei applied the first two patches, will address the other issue mentioned and then push the commits So which release will include this issue fix? (In reply to comment #6) > applied the first two patches, will address the other issue mentioned and then > push the commits Hi All, I've tested the latest release http://download.eclipse.org/jetty/7.5.2.v20111006/dist/jetty-distribution-7.5.2.v20111006.tar.gz. The socket fd leak issue still exists. It's not been fixed in this release: $ lsof -p11016|grep sock java 11016 sunjw 40r sock 0,7 0t0 169110 can't identify protocol java 11016 sunjw 41r unix 0x0000000000000000 0t0 170810 socket java 11016 sunjw 42r sock 0,7 0t0 169112 can't identify protocol (In reply to comment #8) > Hi All, > > I've tested the latest release > http://download.eclipse.org/jetty/7.5.2.v20111006/dist/jetty-distribution-7.5.2.v20111006.tar.gz. > The socket fd leak issue still exists. It's not been fixed in this release: > > $ lsof -p11016|grep sock > java 11016 sunjw 40r sock 0,7 0t0 169110 can't > identify protocol > java 11016 sunjw 41r unix 0x0000000000000000 0t0 170810 socket > java 11016 sunjw 42r sock 0,7 0t0 169112 can't > identify protocol Currently, the code will catch IOException. But UnresolvedAddressException is not an IOException!! Thus, the exception is still not processed correctly. java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException java.lang.IllegalArgumentException java.nio.channels.UnresolvedAddressException Regards. Junwei This bug is the same as https://bugs.eclipse.org/bugs/show_bug.cgi?id=358959. Unfortunately, I misread the inheritance of the UnresolvedAddressException for that one, so it isn't caught by the try/catch of IOException. Note that UnknownHostException IS an IOException so was handled anyway. I've now fixed the SelectorConnector to catch UnresolvedAddressException. This will be in jetty-7.5.3. Jan |