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

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

Ouverte
#3,615 1 commentaire 3 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
Java
Étoiles
944
Forks
242
Merge moyen
1 j 4 h
PR mergées (30 j)
43

Description

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.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par suivre ManagedInformerEventSource à travers InformerManager et InformerWrapper, puis examinez InformerConfiguration ainsi que les points d’entrée existants AbstractInformerPool et ConfigurationServiceOverrider. Comparez ces chemins avec SharedIndexInformer.removeNamespaceIndex(). Le travail est terminé lorsqu’une option de configuration de première classe peut désactiver l’index d’espace de noms par défaut sans nécessiter de sous-classement expérimental du pool, avec une couverture du comportement de démarrage de l’informer.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
backend
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
38/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.