Commit ea7176b
parallelize InformerManager changeNamespaces (#3430)
* parallelize InformerManager changeNamespaces
InformerManager#changeNamespaces starts informers for newly added
namespaces sequentially via Set#forEach. Each source.start() call
blocks up to cacheSyncTimeout waiting for cache sync, so when N
namespaces are added and any of them are slow or RBAC-denied (a
common case under stopOnInformerErrorDuringStartup=false), the
total wall-clock is O(N * cacheSyncTimeout). The Controller holds
its EventProcessor stopped across this entire call, dropping watch
events with "Skipping event ... because the event processor is not
started" and producing multi-minute reconcile delays after dynamic
namespace updates.
Align changeNamespaces with the existing parallel pattern already
used by InformerManager#start (boundedExecuteAndWaitForAllToComplete
on the caching executor). Wall-clock drops from O(N * timeout) to
O(timeout). The sources map is already a ConcurrentHashMap, so no
additional synchronization is required.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Qi Tan <16416018+TQJADE@users.noreply.github.com>1 parent 0a90abc commit ea7176b
1 file changed
Lines changed: 18 additions & 8 deletions
File tree
- operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer
Lines changed: 18 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
124 | 134 | | |
125 | 135 | | |
126 | 136 | | |
| |||
0 commit comments