Skip to content

Commit

Permalink
Add ulimit setting to debian containers in mage build (#32580)
Browse files Browse the repository at this point in the history
* add ulimit to debian containers

* add changelog
  • Loading branch information
fearful-symmetry authored Aug 2, 2022
1 parent 4f8694a commit ee6f470
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff]

- Fix counter for number of events published in `httpjson` input. {pull}31993[31993]
- Fix handling of Checkpoint event for R81. {issue}32380[32380] {pull}32458[32458]
- Fix a hang on `apt-get update` stage in packaging. {pull}32580[32580]

*Heartbeat*

Expand Down
9 changes: 9 additions & 0 deletions dev-tools/mage/crossbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,15 @@ func (b GolangCrossBuilder) Build() error {
verbose = "true"
}
var args []string
// There's a bug on certain debian versions:
// https://discuss.linuxcontainers.org/t/debian-jessie-containers-have-extremely-low-performance/1272
// basically, apt-get has a bug where will try to iterate through every possible FD as set by the NOFILE ulimit.
// On certain docker installs, docker will set the ulimit to a value > 10^9, which means apt-get will take >1 hour.
// This runs across all possible debian platforms, since there's no real harm in it.
if strings.Contains(b.Platform, "debian") {
args = append(args, "--ulimit", "nofile=262144:262144")
}

if runtime.GOOS != "windows" {
args = append(args,
"--env", "EXEC_UID="+strconv.Itoa(os.Getuid()),
Expand Down

0 comments on commit ee6f470

Please sign in to comment.