question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

3.14.1 interceptor regression

See original GitHub issue

I think this is probably a bug in my client code, but it’s a new behaviour so flagging anyway

https://github.com/yschimke/okurl/blob/5a40144ff173e055d60a67f0c51df1ccad07a419/src/main/kotlin/com/baulsupp/okurl/authenticator/RenewingInterceptor.kt#L34

Apr 27, 2019 9:25:20 AM com.baulsupp.cooee.ProdAppServices$client$1$1 log
INFO: [33 ms] requestHeadersStart
Apr 27, 2019 9:25:20 AM com.baulsupp.cooee.ProdAppServices$client$1$1 log
INFO: [33 ms] requestHeadersEnd
Apr 27, 2019 9:25:20 AM com.baulsupp.cooee.ProdAppServices$client$1$1 log
INFO: [34 ms] responseHeadersStart
Apr 27, 2019 9:25:20 AM com.baulsupp.cooee.ProdAppServices$client$1$1 log
INFO: [2835 ms] connectionReleased
Apr 27, 2019 9:25:20 AM com.baulsupp.cooee.ProdAppServices$client$1$1 log
INFO: [2836 ms] callEnd
Exception in thread "OkHttp Dispatcher" java.lang.IllegalStateException: cannot make a new request because the previous response is still open: please call response.close()
	at okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:164)
	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 com.baulsupp.okurl.authenticator.RenewingInterceptor$intercept$1.invokeSuspend(RenewingInterceptor.kt:34)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:238)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.kt:116)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:80)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:54)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:36)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	at com.baulsupp.okurl.authenticator.RenewingInterceptor.intercept(RenewingInterceptor.kt:28)
	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$AsyncCall.execute(RealCall.java:172)
	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

17reactions
ysy950803commented, Sep 19, 2019

@ysy950803 close the response before replacing it with the chain.proceed inside the while loop.

Thanks! It works!

while (!response.isSuccessful() && retryCount < RETRY_MAX_COUNT - 1) {
    retryCount++;
    response.close();
    response = chain.proceed(request);
}
4reactions
yschimkecommented, Jul 3, 2019

Is this the leak within an interceptor case? e.g. RenewingInterceptor in my case?

https://github.com/yschimke/okurl/commit/269bc114cee2529bba9cebdfceac7bce1b15a795#diff-c1ed79514e9258a543ba1c3eb1b45c3e

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lesson 15 Regression | Data Science in R: A Gentle Introduction
In this lesson, we learn about multiple regression models, which incorporate ... Our fitted regression equation now involves an intercept, a slope on...
Read more >
SticiGui Regression - Berkeley Statistics
The slope and intercept of the regression line can be found from the five numbers. The regression line is the line that fits...
Read more >
PMML 4.2 - Regression - Data Mining Group
Dependent variable = intercept + Sumi (coefficienti * independent variablei ) + error. Classification models can have multiple regression equations.
Read more >
Poisson Regression | R Data Analysis Examples - OARC Stats
Poisson regression is used to model count variables. This page uses the following packages. Make sure that you can load them before trying...
Read more >
1 Simple Linear Regression I – Least Squares Estimation
In general, we can write the equation for a straight line as y = β0 + β1x,. 1. Page 2. where β0 is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found