Skip to content
代码片段 群组 项目
未验证 提交 a0130496 编辑于 作者: Stan Hu's avatar Stan Hu
浏览文件

Fix Workhorse failing on 64-bit unaligned access on Raspberry Pi 32-bit

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/177057 added new
fields to the Redis KeyWatcher structure that caused a `panic:
unaligned 64-bit atomic operation` on Raspberry Pi 32-bit builds for
Workhorse.

I was able to reproduce this by on a Raspberry Pi 64-bit system:

1. Install the 32-bit libraries:
   `apt install libc6:armhf libstdc++6:armhf`.

2. Build `gitlab-workhorse` with `GOARCH=arm` and `GOARM=7`
   environment variable set.

3. Spin up a Redis server.

4. Run `gitlab-workhorse` with this `config.toml`:

```
[redis]
URL = "redis://localhost:6379"
```

Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/514010

Changelog: fixed
上级 77ef83e4
No related branches found
No related tags found
无相关合并请求
......@@ -19,11 +19,12 @@ import (
// KeyWatcher is responsible for watching keys in Redis and notifying subscribers.
type KeyWatcher struct {
// Put this field first to ensure backoff.Backoff is aligned for 64-bit access
reconnectBackoff backoff.Backoff
mu sync.Mutex
newSubscriber chan struct{}
subscribers map[string][]chan string
shutdown chan struct{}
reconnectBackoff backoff.Backoff
redisConn *redis.Client // can be nil
conn *redis.PubSub
firstRun bool
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册