You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@yunikorn.apache.org by "Andy Huang (Jira)" <ji...@apache.org> on 2026/09/03 13:43:00 UTC
[jira] [Assigned] (YUNIKORN-3425) Admission controller serving goroutine reads the server field Shutdown nils
[ https://issues.apache.org/jira/browse/YUNIKORN-3425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andy Huang reassigned YUNIKORN-3425:
------------------------------------
Assignee: Andy Huang
> Admission controller serving goroutine reads the server field Shutdown nils
> ---------------------------------------------------------------------------
>
> Key: YUNIKORN-3425
> URL: https://issues.apache.org/jira/browse/YUNIKORN-3425
> Project: Apache YuniKorn
> Issue Type: Sub-task
> Components: shim - kubernetes
> Reporter: Dale Richardson
> Assignee: Andy Huang
> Priority: Major
>
> {{WebHook.Startup}} assigns {{wh.server}} under the mutex and then starts a goroutine that calls {{wh.server.ListenAndServeTLS}} after the lock is released. {{WebHook.Shutdown}} sets the field to {{nil}} under the same mutex. The reload loop in {{main}} runs {{Shutdown()}} then {{Startup()}} on {{SIGUSR1}} and on the certificate-expiry timer, so every rotation exercises the sequence.
> Reproduced on the fork fix branch: the pre-fix test produces both the data race report and the nil-receiver SIGSEGV ({{ListenAndServeTLS(0x0, ...)}}), and the controller's own sequential reload cycle trips the detector without any timing luck. A crash here takes admission down until the pod restarts. In the same critical section {{Shutdown}} holds the mutex across {{http.Server.Shutdown(context.Background())}}, draining in-flight admissions with no timeout while the reload's {{Startup}} waits for the lock.
> Fix: capture the server in a local under the lock at both ends so neither goroutine touches the field outside the critical section; keep the drain synchronous so the port is free before rebinding. A drain timeout is a separate change. A fix exists on the tigerquoll fork (PR #10 there) and will be filed once this has a number.
> Marker: the serving goroutine in {{cmd/admissioncontroller/main.go}} carries this JIRA; the fix removes it.
--
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