Connectionstring files under /tmp keeps growing

enter controller pod, I found a lot of tmp files,
sample ones like

1313432445  1765504520  2252113759  2766782958  3096530237  3535853926  3916635754  458324948   925391022
1333991883  1773089352  2268308434  2771825002  310151260   3541135801  3923197243  460385429   925960843

check contents, mostly are connectionstring
tracing back to operator code, it is in fdbclient/admin_client.go

func NewCliAdminClient(cluster *fdbv1beta2.FoundationDBCluster, _ client.Client, log logr.Logger) (fdbadminclient.AdminClient, error) {
	clusterFile, err := os.CreateTemp("", "")

although the clusterFile is small,

ls -l 3589704616
-rw-------. 1 1000710000 1000710000 121 Nov 21 09:52 3589704616

but in our controller, we’ll call fdbcli commands like 10 times per minute, so it will continously growing, only after a few hours, it is more than 30M, and we set ephemeral-storage to 100M, it will trigger pod evicted because of exceeding the limit.
thinking since connectionstring won’t change much, why for every call we write a tmp file? thanks

We actually have a fix for that: Use deterministic name for cluster file by johscheuer · Pull Request #1374 · FoundationDB/fdb-kubernetes-operator · GitHub. The problem is not that we use a temporary file but rather that those temp files are not cleaned up properly. Initially we used the cluster name but that that some other drawbacks (there are some issues around that topic in the GitHub repository if you’re interested).

I would assume that this fix will be in the next release of the operator.

1 Like