Skip to content

Commit 7ceaf46

Browse files
committed
wip
Signed-off-by: Attila Mészáros <[email protected]>
1 parent 25a632b commit 7ceaf46

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ private boolean onEvent(T resource, boolean unknownState) {
107107
var resourceId = ResourceID.fromResource(resource);
108108
ReentrantLock lock = activelyModifying.get(resourceId);
109109
if (lock != null) {
110+
// note that this is a special case of lock striping; event handling happens
111+
// always on the same thread of the informer we lock only if the update is happening
112+
// for the same resource (not any resource), and if the event comes from the current update
113+
// this should be locked for a very short time, since that update request already send at this
114+
// point.
110115
lock.lock(); // wait for the modification to finish
111116
lock.unlock(); // simply unlock as the event is guaranteed after the modification
112117
}

0 commit comments

Comments
 (0)