File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
package io .javaoperatorsdk .operator .processing .event ;
2
2
3
- import java .util .Collections ;
4
- import java .util .HashSet ;
5
- import java .util .Objects ;
6
- import java .util .Set ;
3
+ import java .util .*;
7
4
import java .util .concurrent .locks .ReentrantLock ;
8
5
9
6
import org .slf4j .Logger ;
@@ -25,7 +22,10 @@ public class EventSourceManager<R extends HasMetadata>
25
22
private static final Logger log = LoggerFactory .getLogger (EventSourceManager .class );
26
23
27
24
private final ReentrantLock lock = new ReentrantLock ();
28
- private final Set <EventSource > eventSources = Collections .synchronizedSet (new HashSet <>());
25
+ // This needs to be a list since the event source must be started in a deterministic order. The
26
+ // controllerResourceEventSource must be always the first to have informers available for other
27
+ // informers to access the main controller cache.
28
+ private final List <EventSource > eventSources = Collections .synchronizedList (new ArrayList <>());
29
29
private final EventProcessor <R > eventProcessor ;
30
30
private TimerEventSource <R > retryAndRescheduleTimerEventSource ;
31
31
private ControllerResourceEventSource <R > controllerResourceEventSource ;
@@ -120,7 +120,7 @@ public void cleanupForCustomResource(ResourceID customResourceUid) {
120
120
121
121
@ Override
122
122
public Set <EventSource > getRegisteredEventSources () {
123
- return Collections . unmodifiableSet (eventSources );
123
+ return new HashSet <> (eventSources );
124
124
}
125
125
126
126
@ Override
You can’t perform that action at this time.
0 commit comments