[
https://issues.apache.org/jira/browse/YUNIKORN-3423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18114829#comment-18114829
]
Hungchih Lee commented on YUNIKORN-3423:
----------------------------------------
I have been assigned to YUNIKORN-3423 and independently reproduced the race
locally.
During investigation, I found an unmerged local review commit
(793d645f423a5cd6474b1fe065d0d44ac2523e05, authored by Dale Richardson)
that implements the same approach. I could not find a corresponding GitHub PR.
I have verified that the patch passes the race regression test, package tests,
make test, make lint, and make license-check.
Could a maintainer please confirm whether this work is still being submitted,
or whether I may prepare a PR based on this approach with appropriate
attribution?
> postAppAccepted reads taskGroups and taskMap without the application lock
> -------------------------------------------------------------------------
>
> Key: YUNIKORN-3423
> URL: https://issues.apache.org/jira/browse/YUNIKORN-3423
> Project: Apache YuniKorn
> Issue Type: Sub-task
> Components: shim - kubernetes
> Reporter: Dale Richardson
> Assignee: Hungchih Lee
> Priority: Major
>
> {{Application.postAppAccepted}} is called from {{Schedule()}} on the
> scheduling ticker with no lock, outside any state-machine transition, unlike
> the other state handlers which are FSM callbacks under {{app.handle}}'s lock.
> It reads {{taskGroups}} and, through {{skipReservationStage}}, ranges over
> {{taskMap}} while the pod informer path keeps adding tasks to that map under
> the lock; pods arrive for an application after it is Accepted as a matter of
> course.
> Confirmed with the race detector: the test on the fork fix branch reproduces
> it on master every time (three reports on this chain). Because the read is a
> {{range}}, the runtime consequence is {{fatal error: concurrent map iteration
> and map write}}, which kills the scheduler.
> Fix: snapshot the decision inputs under one {{RLock}} and release it before
> logging and dispatching. Wrapping the whole body self-deadlocks because
> {{GetAllocatedTasks()}} takes the read lock internally; use the lock-free
> {{getTasks}} twin inside the locked region. A fix exists on the tigerquoll
> fork (PR #12 there) and will be filed once this has a number.
> Marker: {{postAppAccepted}} in {{application.go}} 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]