Skip to content

Informer watch call doesn't respect timeout from CallGenerator #2183

@haoming-db

Description

@haoming-db

Describe the bug
The ReflectorRunnable sets a random 5-10mins timeout for watch call. However, this timeout doesn’t really affect watch call , because: in SharedInformerFactory, it implements a ListerWatcher whose watch call uses underlying client timeout.
At SharedInformerFactory, line 212 returns the call with correct timeout (5-10mins): Call call = callGenerator.generate(params);
However, line 214 generates a new Call object apiClient.getHttpClient().newCall(call.request()). The timeout of the new Call object uses the underlying OkHttpClient.callTimeoutMillis as call timeout, which is by default 0. I understand that the comment says it wants 0 (unlimited) read timeout, but it's not respecting the call timeout, which makes the random 5-10mins timeout for watch call meaningless in ReflectorRunnable.

This means SharedInformerFactory always sets watch call timeout to the callTimeoutMillis of the underlying OkHttpClient (by default 0, unlimited), but not the one set by ReflectorRunnable (5-10mins). If users use default settings, call timeout is 0 - there will never be client-side timeout triggered.

Client Version
At least 13.0.0 and above

Kubernetes Version
n/a

Java Version
n/a

To Reproduce
Create a new SharedInformerFactory using all default settings.

Expected behavior
SharedInformerFactory's listerWatcherFor() should respect the call timeout from CallGenerator.

KubeConfig
n/a

Server (please complete the following information):
n/a

Additional context
n/a

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