diff options
author | John Cai <jcai@gitlab.com> | 2022-05-14 00:18:00 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2022-05-16 15:47:27 +0300 |
commit | 56db80e0e0ca58df83fbc9b97b51773835692ea3 (patch) | |
tree | e1de6de028047213e9dd3bc0e9bf26366983ed4d | |
parent | 07dc211c8d457e82cdc682bea35a4b3e7c2181e3 (diff) |
cgroups: Add delimiter for key
The cgroups key did not have a delimeter. This can potentially cause key
collisions between two different sets of storage/repository path. Add a
"/" as a delimeter in the key that gets hashed.
-rw-r--r-- | internal/cgroups/v1_linux.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/cgroups/v1_linux.go b/internal/cgroups/v1_linux.go index f36d461d2..49802bcb8 100644 --- a/internal/cgroups/v1_linux.go +++ b/internal/cgroups/v1_linux.go @@ -104,7 +104,7 @@ func (cg *CGroupV1Manager) AddCommand( repo repository.GitRepo, ) error { checksum := crc32.ChecksumIEEE( - []byte(strings.Join([]string{repo.GetStorageName(), repo.GetRelativePath()}, "")), + []byte(repo.GetStorageName() + "/" + repo.GetRelativePath()), ) groupID := uint(checksum) % cg.cfg.Repositories.Count cgroupPath := cg.repoPath(int(groupID)) |