You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@livy.apache.org by "Gyorgy Gal (Jira)" <ji...@apache.org> on 2026/08/24 20:51:00 UTC

[jira] [Resolved] (LIVY-1063) Fix resource leak in Kubernetes service account token refresh

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

Gyorgy Gal resolved LIVY-1063.
------------------------------
    Fix Version/s: 1.0.0
       Resolution: Fixed

> Fix resource leak in Kubernetes service account token refresh
> -------------------------------------------------------------
>
>                 Key: LIVY-1063
>                 URL: https://issues.apache.org/jira/browse/LIVY-1063
>             Project: Livy
>          Issue Type: Bug
>            Reporter: Nilesh Rathi
>            Assignee: Nilesh Rathi
>            Priority: Major
>              Labels: kubernetes
>             Fix For: 1.0.0
>
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> RefreshServiceAccountTokenThread in SparkKubernetesApp recreates DefaultKubernetesClient every 5 minutes during service account token refresh. The previous client is never closed, causing a slow resource leak (native threads / HTTP client pools) in long-running Livy deployments on Kubernetes.
> The client is documented as thread-safe and intended to be created once at init(). The refresh loop should only update the OAuth token on the existing client via config.setOauthToken(), not instantiate a new DefaultKubernetesClient.
> Affected code: server/src/main/scala/org/apache/livy/utils/SparkKubernetesApp.scala (introduced in LIVY-702).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)