Skip to content

Commit 5ba48d7

Browse files
committed
wip
Signed-off-by: Attila Mészáros <[email protected]>
1 parent 6ad950b commit 5ba48d7

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,23 @@ public boolean onAddOrUpdateEvent(T resource) {
105105

106106
private boolean onEvent(T resource, boolean unknownState) {
107107
var resourceId = ResourceID.fromResource(resource);
108-
// todo move to trace these log messages
109-
log.debug(
110-
"Processing event for resource id: {} version: {} ",
111-
resourceId,
112-
resource.getMetadata().getResourceVersion());
108+
if (log.isDebugEnabled()) {
109+
log.debug(
110+
"Processing event for resource id: {} version: {} ",
111+
resourceId,
112+
resource.getMetadata().getResourceVersion());
113+
}
113114
ReentrantLock lock = activelyModifying.get(resourceId);
114115
if (lock != null) {
115-
log.debug("Lock for event filtering resource id: {}", resourceId);
116+
log.trace("Lock for event filtering resource id: {}", resourceId);
116117
// note that this is a special case of lock striping; event handling happens
117118
// always on the same thread of the informer we lock only if the update is happening
118119
// for the same resource (not any resource), and if the event comes from the current update
119120
// this should be locked for a very short time, since that update request already send at this
120121
// point.
121122
lock.lock(); // wait for the modification to finish
122123
lock.unlock(); // simply unlock as the event is guaranteed after the modification
123-
log.debug("Unlock for event resource id: {}", resourceId);
124+
log.trace("Unlock for event resource id: {}", resourceId);
124125
}
125126
boolean[] filter = new boolean[1];
126127
synchronized (this) {

0 commit comments

Comments
 (0)