Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2022-11-21 06:09:15 +0300
committerStan Hu <stanhu@gmail.com>2022-11-21 06:09:15 +0300
commitcf3f6fa8a5b5f80a1a0de8046445440a9eeaefce (patch)
tree783cbe6e044b1e61f25fb5b9d7c69329845f8252
parentd535557de9cbe5e32056b0af2bbf48e6d3e66baf (diff)
Fix Gitaly build for 32-bit operating systemssh-int32-gitaly-fix
https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5059 removed a cast for the platform-dependent `rusage` package. On Raspberry Pi (armv7) platforms, these are 32-bit values, but on x86 64 they are 64-bit values. However, the `stats.RecordX` functions expect 64-bit values. This commit fixes the build by casting the values to 64-bit values. Closes https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/7321
-rw-r--r--internal/command/command.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/internal/command/command.go b/internal/command/command.go
index 8ec91e7dc..5198f5bb8 100644
--- a/internal/command/command.go
+++ b/internal/command/command.go
@@ -443,11 +443,12 @@ func (c *Command) logProcessComplete() {
stats.RecordSum("command.real_time_ms", realTime.Milliseconds())
if ok {
- stats.RecordMax("command.maxrss", rusage.Maxrss)
- stats.RecordSum("command.inblock", rusage.Inblock)
- stats.RecordSum("command.oublock", rusage.Oublock)
- stats.RecordSum("command.minflt", rusage.Minflt)
- stats.RecordSum("command.majflt", rusage.Majflt)
+ // Cast to int64 is necessary for 32-bit platforms
+ stats.RecordMax("command.maxrss", int64(rusage.Maxrss))
+ stats.RecordSum("command.inblock", int64(rusage.Inblock))
+ stats.RecordSum("command.oublock", int64(rusage.Oublock))
+ stats.RecordSum("command.minflt", int64(rusage.Minflt))
+ stats.RecordSum("command.majflt", int64(rusage.Majflt))
}
}