Snd-R / komf

Komga and Kavita metadata fetcher
MIT License
321 stars 20 forks source link

java.net.SocketTimeoutException when using multiple metadata sources #111

Closed papaj-na-wrotkach closed 10 months ago

papaj-na-wrotkach commented 1 year ago

I use 7 metadata sources for my Komga library. Recently, when I try to identify series using the userscript I get java.net.SocketTimeoutException in logs:

komf  | java.net.SocketTimeoutException: timeout
komf  |         at okhttp3.internal.http2.Http2Stream$StreamTimeout.newTimeoutException(Http2Stream.kt:675)
komf  |         at okhttp3.internal.http2.Http2Stream$StreamTimeout.exitAndThrowIfTimedOut(Http2Stream.kt:684)
komf  |         at okhttp3.internal.http2.Http2Stream.takeHeaders(Http2Stream.kt:143)
komf  |         at okhttp3.internal.http2.Http2ExchangeCodec.readResponseHeaders(Http2ExchangeCodec.kt:97)
komf  |         at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:110)
komf  |         at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:93)
komf  |         at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
komf  |         at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
komf  |         at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
komf  |         at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
komf  |         at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
komf  |         at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
komf  |         at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
komf  |         at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
komf  |         at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
komf  |         at org.snd.common.http.UserAgentInterceptor.intercept(UserAgentInterceptor.kt:10)
komf  |         at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
komf  |         at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:221)
komf  |         at org.snd.common.http.LoggingInterceptor.intercept(LoggingInterceptor.kt:20)
komf  |         at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
komf  |         at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
komf  |         at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
komf  |         at org.snd.common.http.HttpClient$execute$1.invoke(HttpClient.kt:27)
komf  |         at org.snd.common.http.HttpClient$execute$1.invoke(HttpClient.kt:26)
komf  |         at org.snd.common.http.HttpClient.rateLimited$lambda$0(HttpClient.kt:54)
komf  |         at io.github.resilience4j.ratelimiter.RateLimiter.lambda$decorateCheckedSupplier$3(RateLimiter.java:219)
komf  |         at io.github.resilience4j.retry.Retry.lambda$decorateCheckedSupplier$1(Retry.java:135)
komf  |         at org.snd.common.http.HttpClient.rateLimited(HttpClient.kt:56)
komf  |         at org.snd.common.http.HttpClient.execute(HttpClient.kt:26)
komf  |         at org.snd.metadata.providers.mangaupdates.MangaUpdatesClient.searchSeries(MangaUpdatesClient.kt:44)
komf  |         at org.snd.metadata.providers.mangaupdates.MangaUpdatesMetadataProvider.searchSeries(MangaUpdatesMetadataProvider.kt:64)
komf  |         at org.snd.metadata.MetadataProvider$DefaultImpls.searchSeries$default(MetadataProvider.kt:18)
komf  |         at org.snd.mediaserver.MetadataService.searchSeriesMetadata_7R2r78w$lambda$1$lambda$0(MetadataService.kt:48)
komf  |         at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
komf  |         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
komf  |         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
komf  |         at java.base/java.lang.Thread.run(Unknown Source)

Is there a way to increase the timeout limit value?

Snd-R commented 1 year ago

It might have been a temporary issue with mangaupdates. Timeout is set to 10 seconds and request is retried 3 times, usually that's enough Do you still have this issue?

papaj-na-wrotkach commented 1 year ago

No, I don't have any issues today. The problem has been there for the last few days, but now it is fine. I guess it was a temporary issue with some provider. Still, it is strange because I experimented with 3 providers and each one worked fine when it was the only one enabled. When I enabled all of them - the issue was present.

I think the issue can be closed now. I'll report back if the problem ever comes back so we can investigate it further.