Skip to content

Temporal resource miss on Informer index #7265

@csviri

Description

@csviri

Describe the bug

If I add an index to the Informer, and later retrieve resource using byIndex sometimes not the entire set of resources are received. This is caused by the fact that when the informer updates index first it removes the old item later adds it. So when reading the just in time that event is received, it might not return the related item:

https://github.com/csviri/kubernetes-client/blob/6fe86db49817093168a3f11a5f363374a8d68c48/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/informers/impl/cache/CacheImpl.java#L277-L279

I know that it is noted in the Javadoc that this is because it is not fully synchronized, and we probably don't want that since would affect the performance, but maybe we can find a different solution

go client:
https://github.com/kubernetes/cri-client

Fabric8 Kubernetes Client version

7.3.1

Steps to reproduce

Not easy to repdouce, easies is just have an event handler that reads the index.

Expected behavior

all the items are received

Runtime

Kubernetes (vanilla)

Kubernetes API Server version

1.33

Environment

Linux, macOS

Fabric8 Kubernetes Client Logs

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions