You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The HLF operator pod is continuously creating temporary files in the /tmp directory without cleanup, leading to potential disk space issues. The temporary files are CA certificate-related files that are being created during CA client operations.
$ ls | wc -l
72655
# After a few moments...
$ ls | wc -l
74761
$ ls | head
ca-cert1000328084
ca-cert1000572008
ca-cert1000588891
...
Root Cause
The GetClient function in the certs package creates temporary directories and files for CA operations but does not implement cleanup mechanisms:
funcGetClient(caFabricCAParams) (*lib.Client, error) {
caHomeDir, err:=ioutil.TempDir("", "fabric-ca-client") // Not cleaned upcaCertFile, err:=ioutil.TempFile("", "ca-cert") // Not cleaned up...
}
This function is frequently called by operations like EnrollUser, ReenrollUser, GetCAInfo, etc., causing the accumulation of temporary files.
Added helper function WithClient to handle cleanup in a structured way
Modified existing functions to use the new cleanup pattern
Impact
Prevents accumulation of temporary files in the pod
Reduces disk space usage
Proper resource cleanup after operations
Maintains existing functionality while adding proper resource management
What did you expect to happen?
.
How can we reproduce it (as minimally and precisely as possible)?
.
Anything else we need to know?
No response
Kubernetes version
OS
linux (amd64)
OS Image
Fedora CoreOS 39.20240731.base.0
Kernel version
6.5.12-300.fc39.x86_64
Container runtime
containerd://1.7.10
Kubelet version
v1.27.11
The text was updated successfully, but these errors were encountered:
What happened?
Issue Description
The HLF operator pod is continuously creating temporary files in the
/tmp
directory without cleanup, leading to potential disk space issues. The temporary files are CA certificate-related files that are being created during CA client operations.Root Cause
The
GetClient
function in the certs package creates temporary directories and files for CA operations but does not implement cleanup mechanisms:This function is frequently called by operations like
EnrollUser
,ReenrollUser
,GetCAInfo
, etc., causing the accumulation of temporary files.Solution (AI gen..)
defer
:Implementation Details
Added
defer
statements for cleanup of:Improved error handling with descriptive messages
Added helper function
WithClient
to handle cleanup in a structured wayModified existing functions to use the new cleanup pattern
Impact
What did you expect to happen?
.
How can we reproduce it (as minimally and precisely as possible)?
.
Anything else we need to know?
No response
Kubernetes version
OS
linux (amd64)
OS Image
Fedora CoreOS 39.20240731.base.0
Kernel version
6.5.12-300.fc39.x86_64
Container runtime
containerd://1.7.10
Kubelet version
v1.27.11
The text was updated successfully, but these errors were encountered: