sourcegraph/.github
Thorsten Ball 82215eb8c1
Enable CGO on sg binary releases to fix "too many open files" bug (#28393)
This fixes #28354 by using `CGO_ENABLED=1` when building `sg` binaries. We didn't do that in the past because we didn't know it was that easy to run on `macos-latest` in GitHub workflows.

And using `CGO_ENABLED=0` caused the file-watching library we're using - github.com/rjeczalik/notify - to fallback to `kqueue` to watch files on macOS. That in turn is not performant when watching files in large folders. It seems to open/stat every file in our repository which then lead to a "too many open files" error.

(You can see this in action if you compile `sg` with `CGO_ENABLED=0 go build -o sg .` and then run `sudo dtruss ./sg run github-proxy` on macOS. You'll see _ton_ of `open` and `stat` syscalls.)

With CGO enabled though, `notify` uses `FSEvents` on macOS which handles our repository much better.

And that also explains why building `sg` locally fixed the issue: locally we didn't turn CGO off.
2021-12-01 16:32:26 +01:00
..
ISSUE_TEMPLATE web: update external contractor issue template (#27410) 2021-11-12 11:55:09 +00:00
PULL_REQUEST_TEMPLATE Add browser extension CHANGELOD.md + Update PR template (#27141) 2021-11-10 19:07:54 +03:00
workflows Enable CGO on sg binary releases to fix "too many open files" bug (#28393) 2021-12-01 16:32:26 +01:00
CODEOWNERS Update documentation for Codenotify experiment (#16407) 2020-12-04 14:15:01 -08:00
PULL_REQUEST_TEMPLATE.md Change team from distrib to delivery (#27391) 2021-11-10 23:33:06 +00:00
teams.yml web: Team Labeler Github action (#19741) 2021-04-08 16:42:43 +08:00