I got a SocketTimeout Exception while invoking “v1/audio/speech” API. The timeout value we are using is 10 seconds. Again, it was happening randomly, once in ~30-50 requests. This is the snippet of an exception:
Sep 11 23:35:10 ip-10-0-2-61 web: java.net.SocketTimeoutException: timeout
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.http2.Http2Stream$StreamTimeout.newTimeoutException(Http2Stream.kt:675) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.http2.Http2Stream$StreamTimeout.exitAndThrowIfTimedOut(Http2Stream.kt:684) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.http2.Http2Stream.takeHeaders(Http2Stream.kt:143) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.http2.Http2ExchangeCodec.readResponseHeaders(Http2ExchangeCodec.kt:96) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:106) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:79) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154) ~[okhttp-4.9.3.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at retrofit2.OkHttpCall.execute(OkHttpCall.java:180) ~[retrofit-2.3.0.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:46) ~[adapter-rxjava2-2.9.0.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at io.reactivex.Observable.subscribe(Observable.java:12284) ~[rxjava-2.2.21.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:35) ~[adapter-rxjava2-2.9.0.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at io.reactivex.Observable.subscribe(Observable.java:12284) ~[rxjava-2.2.21.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at io.reactivex.internal.operators.observable.ObservableSingleSingle.subscribeActual(ObservableSingleSingle.java:35) ~[rxjava-2.2.21.jar!/:na]
Sep 11 23:35:10 ip-10-0-2-61 web: at io.reactivex.Single.subscribe(Single.java:3666) ~[rxjava-2.2.21.jar!/:na]