Ericsson / CodeCheckerEclipsePlugin

This is an Eclipse plugin that shows C/C++ static analysis results found by Clang Static Analyzer and Clang Tidy
Eclipse Public License 1.0
32 stars 13 forks source link

Thrift communication errors -- heavy exception flood #67

Closed whisperity closed 6 years ago

whisperity commented 8 years ago

There are certain cases when Thrift starts to generate heavy COMMUNICATION_ERRORs.

Cases

There might be more causes, these are just the list of those discovered so far!


It seems like that all these issues boil down to the fact that the codes calling Thrift assumes that

These are all assumptions that are NOT invariant to every project, so these assumptions should be eliminated from the code. In the event these conditions do not hold true, access to the server should not be sent.

Maybe it's an issue with CodeChecker itself, that it does not respond in an orderly fashion when I try to get results for something nonexistent? I'm summoning @gyorb and @Xazax-hun to this discussion.


Example

The exceptions look something like this:

2016-08-16 13:16:49 Thread-14 ERROR ThriftActionImpl:35 - Error in cc.ecl.action.thrift transport creation org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused at org.apache.thrift.transport.THttpClient.flush(THttpClient.java:356) at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:65) at cc.codechecker.service.thrift.gen.CodeCheckerDBAccess$Client.send_getRunData(CodeCheckerDBAccess.java:163) at cc.codechecker.service.thrift.gen.CodeCheckerDBAccess$Client.getRunData(CodeCheckerDBAccess.java:156) at cc.codechecker.api.thrift.run.list.ListRunsActionThriftImpl.runThrift(ListRunsActionThriftImpl.java:38) at cc.codechecker.api.thrift.run.list.ListRunsActionThriftImpl.runThrift(ListRunsActionThriftImpl.java:22) at cc.ecl.action.thrift.ThriftActionImpl.doRealRun(ThriftActionImpl.java:33) at cc.ecl.action.thrift.ThriftActionImpl.doRealRun(ThriftActionImpl.java:17) at cc.ecl.action.AbstractActionImpl.doRun(AbstractActionImpl.java:44) at cc.ecl.action.Action.runWithImpl(Action.java:64) at cc.ecl.action.SimpleActionRunner.requireResult(SimpleActionRunner.java:152) at cc.codechecker.api.thrift.result.count.ResultCountActionThriftImpl.runThrift(ResultCountActionThriftImpl.java:54) at cc.codechecker.api.thrift.result.count.ResultCountActionThriftImpl.runThrift(ResultCountActionThriftImpl.java:23) at cc.ecl.action.thrift.ThriftActionImpl.doRealRun(ThriftActionImpl.java:33) at cc.ecl.action.thrift.ThriftActionImpl.doRealRun(ThriftActionImpl.java:17) at cc.ecl.action.AbstractActionImpl.doRun(AbstractActionImpl.java:44) at cc.ecl.action.Action.runWithImpl(Action.java:64) at cc.ecl.action.ActionQueue$QueueItem.runAction(ActionQueue.java:89) at cc.ecl.action.SimpleActionRunner.runAction(SimpleActionRunner.java:53) at cc.ecl.action.SimpleActionRunner.run(SimpleActionRunner.java:98) at java.lang.Thread.run(Thread.java:745) Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at sun.net.NetworkClient.doConnect(NetworkClient.java:180) at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) at sun.net.www.http.HttpClient.(HttpClient.java:211) at sun.net.www.http.HttpClient.New(HttpClient.java:308) at sun.net.www.http.HttpClient.New(HttpClient.java:326) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1169) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:933) at org.apache.thrift.transport.THttpClient.flush(THttpClient.java:344) ... 20 more

whisperity commented 8 years ago

The solution in #72 is a situational hackfix as discussed in Ericsson/codechecker#356.

Lines like these [1] should be enclosed in some sort of exception wrapping. See @gyorb's explanation in the referenced issue.

@dkrupp, I think we should reopen this issue as it disuccess a deeper underlying problem.

dkrupp commented 6 years ago

the whole thing was rewritten now...