Skip to content

EventHandler ResyncPeriod overriding is not respected in DefaultSharedIndexInformer.java #2219

@haoming-db

Description

@haoming-db

Describe the bug
EventHandler ResyncPeriod overriding is not respected in DefaultSharedIndexInformer.java
This line has a bug: https://github.com/kubernetes-client/java/blob/automated-release-15.0.1/util/src/main/java/io/kubernetes/client/informer/impl/DefaultSharedIndexInformer.java#L195
The determineResyncPeriod(resyncCheckPeriodMillis, this.resyncCheckPeriodMillis) is taking 2 identical arguments. It should be determineResyncPeriod(resyncPeriodMillis, this.resyncCheckPeriodMillis).

See the go client implementation: https://github.com/kubernetes/client-go/blob/release-13.0/tools/cache/shared_informer.go#L427

The consequence of this bug: EventHandler's ResyncPeriod overriding is NOT respected.

Please note that fixing this bug might have some risk - some users might set ResyncPeriod to 0 in their EventHandler, and have been relying on this bug to get resync, though by design there should be no resync if ResyncPeriod is set to 0 in EventHandler.

Client Version
All

Kubernetes Version
All

Java Version
N/A

To Reproduce
Override ResyncPeriod in EventHandler to be multiples of the default ResyncCheckPeriod of Informer, and you can see your overriding is not taking effects.

Expected behavior
See the go client implementation: https://github.com/kubernetes/client-go/blob/release-13.0/tools/cache/shared_informer.go#L427

KubeConfig
N/A

Server (please complete the following information):
N/A

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.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