Skip to content

Commit 6ee16fc

Browse files
committed
improve: onList removal of ghost resources
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
1 parent 3ec985d commit 6ee16fc

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/ManagedInformerEventSource.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,7 @@ public synchronized void start() {
155155
}
156156
temporaryResourceCache =
157157
new TemporaryResourceCache<>(
158-
comparableResourceVersions,
159-
configuration.getInformerConfig().getGhostResourceCacheCheckInterval().toMillis(),
160-
controllerConfiguration
161-
.getConfigurationService()
162-
.getExecutorServiceManager()
163-
.scheduledExecutorService(),
164-
this);
158+
comparableResourceVersions,this);
165159
this.cache = new InformerManager<>(client, configuration, this);
166160
cache.setControllerConfiguration(controllerConfiguration);
167161
cache.addIndexers(indexers);

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/TemporaryResourceCache.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,9 @@ public enum EventHandling {
7171

7272
public TemporaryResourceCache(
7373
boolean comparableResourceVersions,
74-
long ghostResourceCheckInterval,
75-
ScheduledExecutorService ghostCheckExecutor,
7674
ManagedInformerEventSource<T, ?, ?> managedInformerEventSource) {
7775
this.comparableResourceVersions = comparableResourceVersions;
7876
this.managedInformerEventSource = managedInformerEventSource;
79-
if (comparableResourceVersions) {
80-
ghostCheckExecutor.scheduleWithFixedDelay(
81-
this::checkGhostResources,
82-
ghostResourceCheckInterval,
83-
ghostResourceCheckInterval,
84-
TimeUnit.MILLISECONDS);
85-
}
8677
}
8778

8879
public synchronized void startEventFilteringModify(ResourceID resourceID) {
@@ -240,7 +231,7 @@ private String getLastSyncResourceVersion(String namespace) {
240231
* In this case neither the ADD nor DELETE event will be propagated to the informer, but we
241232
* explicitly add resources to this cache. Those are cleaned up by this check.
242233
*/
243-
private void checkGhostResources() {
234+
public void checkGhostResources() {
244235
log.debug("Checking for ghost resources.");
245236
var iterator = cache.entrySet().iterator();
246237
while (iterator.hasNext()) {

pom.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
7171
<fabric8-httpclient-impl.name>jdk</fabric8-httpclient-impl.name>
7272
<junit.version>6.0.3</junit.version>
73-
<fabric8-client.version>7.6.1</fabric8-client.version>
73+
<fabric8-client.version>7.7-SNAPSHOT</fabric8-client.version>
7474
<slf4j.version>2.0.17</slf4j.version>
7575
<log4j.version>2.25.3</log4j.version>
7676
<mokito.version>5.23.0</mokito.version>
@@ -621,4 +621,15 @@
621621
</build>
622622
</profile>
623623
</profiles>
624+
625+
<repositories>
626+
<repository>
627+
<id>sonatype-snapshots</id>
628+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
629+
<snapshots>
630+
<enabled>true</enabled>
631+
</snapshots>
632+
</repository>
633+
</repositories>
634+
624635
</project>

0 commit comments

Comments
 (0)