Skip to content

OkHttp3.Call doesn't have timeout by default #2935

@bacek

Description

@bacek

Describe the bug
Java Client is using OkHttp3.Call for most (all?) of processing. Default OkHttp3.Call doesn't have timeout configured.

Which leads to problems like apiClient hanging in case of network bleeps.

Client Version
19.0.0

Kubernetes Version
1.26

Java Version
Java 11

To Reproduce
Steps to reproduce the behavior:

Expected behavior
apiClient calls not to hang forever.

Additional context
We have tightly locked k8s cluster with Istio. We submit a lot (1000+) jobs to k8s using batch/job.

When load burst happens, istio-proxy can have some hiccup, with errors like this:

WARNING: A connection to https://172.20.0.1/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);

When this happen call

batchApi.createNamespacedJob(this.namespace, job, null, null, "k8sBatchService", FIELD_VALIDATION);

just hangs forever.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions