Skip to content

Commit 89ec5c3

Browse files
committed
Suspected bug in informer cache access
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
1 parent 5daec11 commit 89ec5c3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ public void handleRecentResourceCreate(ResourceID resourceID, R resource) {
193193
public Optional<R> get(ResourceID resourceID) {
194194
Optional<R> resource = temporaryResourceCache.getResourceFromCache(resourceID);
195195
var res = cache.get(resourceID);
196+
if (log.isDebugEnabled()) {
197+
log.debug(
198+
"Latest sync version: {}",
199+
manager().lastSyncResourceVersion(resourceID.getNamespace().orElse(null)));
200+
}
196201
if (comparableResourceVersions
197202
&& resource.isPresent()
198203
&& ReconcilerUtilsInternal.compareResourceVersions(
@@ -203,8 +208,9 @@ public Optional<R> get(ResourceID resourceID) {
203208
return resource;
204209
}
205210
log.debug(
206-
"Resource not found, or older, in temporary cache. Found in informer cache {}, for"
207-
+ " Resource ID: {}",
211+
"Resource found in temp cache: {}, or older, in temporary cache. Found in informer cache"
212+
+ " {}, for Resource ID: {}",
213+
resource.isPresent(),
208214
res.isPresent(),
209215
resourceID);
210216
return res;

0 commit comments

Comments
 (0)