You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@yunikorn.apache.org by "weichen lai (Jira)" <ji...@apache.org> on 2026/08/14 15:31:00 UTC

[jira] [Assigned] (YUNIKORN-3363) Event system restarts after Stop(): configmap callback never deregistered, leaking handler and publisher goroutines

     [ https://issues.apache.org/jira/browse/YUNIKORN-3363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

weichen lai reassigned YUNIKORN-3363:
-------------------------------------

    Assignee: weichen lai

> Event system restarts after Stop(): configmap callback never deregistered, leaking handler and publisher goroutines
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: YUNIKORN-3363
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-3363
>             Project: Apache YuniKorn
>          Issue Type: Bug
>          Components: core - scheduler
>            Reporter: Dale Richardson
>            Assignee: weichen lai
>            Priority: Major
>              Labels: newbie
>
> Follow-up to YUNIKORN-3357 (goleak adoption, PR #1124); burns down leakcheck exemptions events.(*EventSystemImpl).StartServiceWithPublisher.func1 and events.(*eventPublisher).start.func1.
> {{events.Init()}} registers a configmap callback ({{{}event_system.go{}}}) that {{EventSystemImpl.Stop()}} never removes via {{configs.RemoveConfigMapCallback}} — compare {{{}health_checker.go{}}}, which deregisters correctly. Any configuration reload after {{Stop()}} runs {{reloadConfig() -> restart()}} and resurrects an event system that nobody holds a reference to; its handler ({{{}StartServiceWithPublisher.func1{}}}) and publisher ({{{}eventPublisher.start.func1{}}}) goroutines then run for the life of the process.
> Aggravator: {{eventSystemId}} is {{{}fmt.Sprintf("event-system-%d", time.Now().Unix()){}}}, so repeated {{Init()}} calls collide on the callback key within a second and accumulate across seconds.
> Proposed fix:
>  * deregister the callback in {{Stop()}} (or re-register in {{{}StartServiceWithPublisher{}}})
>  * use a unique id (uuid) instead of a unix-seconds timestamp
>  * delete the two events exemptions in {{pkg/common/leakcheck/leakcheck.go}}



--
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