You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tz...@apache.org on 2020/09/01 10:04:43 UTC

[flink-statefun] 02/07: [FLINK-19106] [core] Apply timeout configs to OkHttp client

This is an automated email from the ASF dual-hosted git repository.

tzulitai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink-statefun.git

commit d497958709600536ce064abcd39a1389ac249888
Author: Tzu-Li (Gordon) Tai <tz...@apache.org>
AuthorDate: Tue Sep 1 13:49:35 2020 +0800

    [FLINK-19106] [core] Apply timeout configs to OkHttp client
---
 .../apache/flink/statefun/flink/core/httpfn/HttpFunctionProvider.java  | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/httpfn/HttpFunctionProvider.java b/statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/httpfn/HttpFunctionProvider.java
index 8c8d064..ddc4dbc 100644
--- a/statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/httpfn/HttpFunctionProvider.java
+++ b/statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/httpfn/HttpFunctionProvider.java
@@ -64,6 +64,9 @@ public class HttpFunctionProvider implements StatefulFunctionProvider {
     }
     OkHttpClient.Builder clientBuilder = sharedClient.newBuilder();
     clientBuilder.callTimeout(spec.maxRequestDuration());
+    clientBuilder.connectTimeout(spec.connectTimeout());
+    clientBuilder.readTimeout(spec.readTimeout());
+    clientBuilder.writeTimeout(spec.writeTimeout());
 
     final HttpUrl url;
     if (spec.isUnixDomainSocket()) {