Problem with the duration of the background tasks

Hello!
I apologize in advance for my English.

There was a problem with the duration of the background tasks. when project verification starts with the quality gate “sonar way”, the process freezes for 4 hours, after which other projects are checked, the verification time of which does not exceed 10 seconds. if you transfer this project from “sonar way” to “low quality” (where there are no rules), then the check passes in a few seconds.

Sonarqube: 8.2
Sonarscaner: 4.2
Sonarlint: 8.2

Logs CE:

ERROR ce[][c.s.C.D.D.B] An exception was thrown during merge request decoration : couldn't kickstart handshaking
ERROR ce[][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Execution of task class com.sonarsource.C.D.a failed
Java.lang.IllegalStateException: couldn't kickstart handshaking
***
Caused by: javax.net.ssl.SSLException: couldn't kickstart handshaking
***
    Suppressed: java.net.SocketException: broken pipe (write failed)
    ***
Caused by: java.net.SocketException: broken pipe (write failed)
INFO ce[][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull request decoration | status=failed | time=15194047ms
INFO ce[][o.s.c.t.CeWorkerImpl] Executed task | project=xxx | type=report | pullRequest=1 | id=yyy | submitter=gitlab | status=SUCCESS | time=15194986ms

“Show warnings” in background tasks:

Merge request decoration failed. Please check your configuration and the connectivity to gitlab

I can’t provide a lot of logs yet.

let me know if you need anything else to solve the problem

Hi, could you please post the full stack traces?

Do the projects succeeding within a reasonable amount of time have merge request decoration happening? Looks like the problem is related to decorating the merge request in gitlab.

Sorry for the long answer
Here is the complete error log:

    2020.03.12 04:10:26 ERROR ce[AXDMB9f2ny8P9PgEHUuo][c.s.C.D.D.B] An exception was thrown during Merge Request decoration : Couldn't kickstart handshaking
        2020.03.12 04:10:26 ERROR ce[AXDMB9f2ny8P9PgEHUuo][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Execution of task class com.sonarsource.C.D.a failed
        java.lang.IllegalStateException: Couldn't kickstart handshaking
        	at com.sonarsource.C.D.D.F.A(Unknown Source)
        	at com.sonarsource.C.D.D.B.A(Unknown Source)
        	at com.sonarsource.C.D.a.A(Unknown Source)
        	at java.base/java.util.Optional.ifPresent(Unknown Source)
        	at com.sonarsource.C.D.a.B(Unknown Source)
        	at com.sonarsource.C.D.a.A(Unknown Source)
        	at org.sonar.ce.async.SynchronousAsyncExecution.addToQueue(SynchronousAsyncExecution.java:27)
        	at com.sonarsource.C.D.a.A(Unknown Source)
        	at java.base/java.util.Optional.ifPresent(Unknown Source)
        	at com.sonarsource.C.D.a.finished(Unknown Source)
        	at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.executeTask(PostProjectAnalysisTasksExecutor.java:118)
        	at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.finished(PostProjectAnalysisTasksExecutor.java:109)
        	at org.sonar.ce.task.step.ComputationStepExecutor.executeListener(ComputationStepExecutor.java:91)
        	at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:63)
        	at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
        	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:209)
        	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:191)
        	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:158)
        	at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:133)
        	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:85)
        	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
        	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
        	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
        	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
        	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        	at java.base/java.lang.Thread.run(Unknown Source)
        Caused by: javax.net.ssl.SSLException: Couldn't kickstart handshaking
        	at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
        	at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
        	at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
        	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        	at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:336)
        	at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:300)
        	at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:185)
        	at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224)
        	at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108)
        	at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88)
        	at okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:169)
        	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41)
        	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
        	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
        	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
        	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
        	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
        	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
        	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:221)
        	at okhttp3.RealCall.execute(RealCall.java:81)
        	... 30 common frames omitted
        	Suppressed: java.net.SocketException: Broken pipe (Write failed)
        		at java.base/java.net.SocketOutputStream.socketWrite0(Native Method)
        		at java.base/java.net.SocketOutputStream.socketWrite(Unknown Source)
        		at java.base/java.net.SocketOutputStream.write(Unknown Source)
        		at java.base/sun.security.ssl.SSLSocketOutputRecord.encodeAlert(Unknown Source)
        		... 53 common frames omitted
        Caused by: java.net.SocketException: Broken pipe (Write failed)
        	at java.base/java.net.SocketOutputStream.socketWrite0(Native Method)
        	at java.base/java.net.SocketOutputStream.socketWrite(Unknown Source)
        	at java.base/java.net.SocketOutputStream.write(Unknown Source)
        	at java.base/sun.security.ssl.SSLSocketOutputRecord.flush(Unknown Source)
        	at java.base/sun.security.ssl.HandshakeOutStream.flush(Unknown Source)
        	at java.base/sun.security.ssl.ClientHello$ClientHelloKickstartProducer.produce(Unknown Source)
        	at java.base/sun.security.ssl.SSLHandshake.kickstart(Unknown Source)
        	at java.base/sun.security.ssl.ClientHandshakeContext.kickstart(Unknown Source)
        	at java.base/sun.security.ssl.TransportContext.kickstart(Unknown Source)
        	... 51 common frames omitted
        2020.03.12 04:10:26 INFO  ce[AXDMB9f2ny8P9PgEHUuo][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=FAILED | time=15194047ms
        2020.03.12 04:10:26 INFO  ce[AXDMB9f2ny8P9PgEHUuo][o.s.c.t.CeWorkerImpl] Executed task | project=xxx | type=REPORT | pullRequest=1 | id=AXDMB9f2ny8P9PgEHUuo | submitter=gitlab | status=SUCCESS | time=15194986ms

Let me know if you need anything else