Skip to content

Commit ee6f470

Browse files
Add ulimit setting to debian containers in mage build (#32580)
* add ulimit to debian containers * add changelog
1 parent 4f8694a commit ee6f470

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

CHANGELOG.next.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff]
5555

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

5960
*Heartbeat*
6061

dev-tools/mage/crossbuild.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,15 @@ func (b GolangCrossBuilder) Build() error {
296296
verbose = "true"
297297
}
298298
var args []string
299+
// There's a bug on certain debian versions:
300+
// https://discuss.linuxcontainers.org/t/debian-jessie-containers-have-extremely-low-performance/1272
301+
// basically, apt-get has a bug where will try to iterate through every possible FD as set by the NOFILE ulimit.
302+
// On certain docker installs, docker will set the ulimit to a value > 10^9, which means apt-get will take >1 hour.
303+
// This runs across all possible debian platforms, since there's no real harm in it.
304+
if strings.Contains(b.Platform, "debian") {
305+
args = append(args, "--ulimit", "nofile=262144:262144")
306+
}
307+
299308
if runtime.GOOS != "windows" {
300309
args = append(args,
301310
"--env", "EXEC_UID="+strconv.Itoa(os.Getuid()),

0 commit comments

Comments
 (0)