operator-framework / operator-framework/java-operator-sdk

Allow disabling or removing the default namespace index of an event source's informer

Aperta
#3,615 1 commento 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Java
Stelle
944
Fork
242
Merge medio
1g 4h
PR unite (30g)
43

Descrizione

For InformerEventSources, fabric8's default "namespace" index is unused: InformerWrapper.list(namespace) filters the item store directly, and byIndex only serves the JOSDK-qualified custom indexes. The index still costs one entry per object in the watched scope, and when an event source uses a filtering ItemStore to bound its cache, this unused index becomes the dominant retained memory (compounded by the fabric8 cleanup gap reported in fabric8io/kubernetes-client#8103).

fabric8 already exposes SharedIndexInformer.removeIndexer(String), but the SDK offers no path to the informer (it sits behind ManagedInformerEventSource's InformerManager and InformerWrapper, all inaccessible), so today the only way is reflection over three private fields (see the edit below, the experimental informer pool provides a path).

Suggestion: an InformerConfiguration flag (e.g. withoutNamespaceIndex()) applied when the wrapper starts the informer, or an extension point that hands advanced users the SharedIndexInformer for tuning.

Would you be open to a PR for this, and which of the two shapes would you prefer?

EDIT: found out that overriding AbstractInformerPool.start (via ConfigurationServiceOverrider.withInformerPool) allows calling SharedIndexInformer.removeNamespaceIndex() before the informer starts, so reflection is not required after all. The API is marked experimental though, and subclassing the pool for a per-informer concern is indirect, so we think a first-class InformerConfiguration option is still worth it. Happy to include that context in the PR.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia tracciando ManagedInformerEventSource attraverso InformerManager e InformerWrapper, quindi esamina InformerConfiguration e i punti di ingresso esistenti AbstractInformerPool e ConfigurationServiceOverrider. Confronta questi percorsi con SharedIndexInformer.removeNamespaceIndex(). Il lavoro è completo quando un’opzione di configurazione di prima classe può disabilitare l’indice dello spazio dei nomi predefinito senza richiedere il subclassing sperimentale del pool, con una copertura del comportamento di avvio dell’informer.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
backend
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.