Dale Richardson created YUNIKORN-3429:
-----------------------------------------
Summary: onReserving's goroutine reads originatingTask after the
lock is released
Key: YUNIKORN-3429
URL: https://issues.apache.org/jira/browse/YUNIKORN-3429
Project: Apache YuniKorn
Issue Type: Bug
Components: shim - kubernetes
Reporter: Dale Richardson
{{onReserving}} runs under {{app.handle}}'s lock but spawns a goroutine for
placeholder creation, and that goroutine's failure path reads
{{app.originatingTask}} long after the lock is gone. {{setOriginatingTask}}
writes the field under the lock when the originator pod is identified, which
can happen late (recovery, out-of-order arrival of gang members).
Confirmed with the race detector on the fork fix branch (the write is triggered
from the application event handler just before the read). The consequence is
benign: the warning event is posted against a stale originator, or skipped.
Fix: capture the originating task into a local before spawning the goroutine
(the capture happens inside the caller's locked region) and use the local for
the event. A fix exists on the tigerquoll fork (PR #11 there) and will be filed
once this has a number.
Marker: the goroutine in {{onReserving}} carries this JIRA; the fix removes it.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]