You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@yunikorn.apache.org by "Wilfred Spiegelenburg (Jira)" <ji...@apache.org> on 2026/08/27 04:57:00 UTC
[jira] [Commented] (YUNIKORN-3416) UserGroupCache cleanup locks the singleton instead of the receiver; nil dereference after Stop()
[ https://issues.apache.org/jira/browse/YUNIKORN-3416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18108643#comment-18108643 ]
Wilfred Spiegelenburg commented on YUNIKORN-3416:
-------------------------------------------------
this will be fixed as part of a cleanup of the LDAP provider
> UserGroupCache cleanup locks the singleton instead of the receiver; nil dereference after Stop()
> ------------------------------------------------------------------------------------------------
>
> Key: YUNIKORN-3416
> URL: https://issues.apache.org/jira/browse/YUNIKORN-3416
> Project: Apache YuniKorn
> Issue Type: Sub-task
> Components: core - common
> Reporter: Dale Richardson
> Assignee: Wilfred Spiegelenburg
> Priority: Minor
>
> {{cleanUpCache}} and {{resetCache}} lock the package-global {{instance}} while mutating the receiver's map {{c.ugs}}. In production the two are the same object, so the map is protected by accident. Where it goes wrong is {{Stop()}}: it sets {{instance = nil}}, and a cleaner run that has already picked its timer branch dereferences nil in {{cleanUpCache}}. That is a crash at shutdown (or on an in-process restart, YUNIKORN-3370). The non-singleton constructors are exported too, and such a cache mutates its map under a different cache's lock.
> Reproduced on the fork fix branch (the nil dereference and the non-singleton case both fail before the fix; the {{Stop()}} versus cleaner ordering shows under {{-race}}).
> Fix: lock the receiver ({{c.lock}}) in both functions. A fix exists on the tigerquoll fork ({{fix/usergroup-cache-receiver-locking}}, PR #18 there) and will be filed once this has a number. Not covered by it and left with YUNIKORN-3370: {{stopped}} is never cleared, and {{GetUserGroupCache}}'s {{return instance}} still races the nil write.
> Marker: three {{+checklocksignore}} sites in {{usergroup.go}} carry this JIRA; the fix removes them.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: issues-help@yunikorn.apache.org