From a84581552011a39ec23d20ac3ff8d756c2e18462 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 22 Apr 2019 14:53:55 -0700 Subject: [PATCH] Double stack size on gitea Git can segfault and cause a gitea error due to the size of the openstack/openstack repo. Give it more stack space. The hard limit is a workaround for https://github.com/moby/moby/issues/39125 Change-Id: Ibce79d8ab27af3070bf9c5f584d0d78f2b266388 --- playbooks/roles/gitea/templates/docker-compose.yaml.j2 | 4 ++++ testinfra/test_gitea.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/playbooks/roles/gitea/templates/docker-compose.yaml.j2 b/playbooks/roles/gitea/templates/docker-compose.yaml.j2 index fbdf4a069f..ecb4061fd8 100644 --- a/playbooks/roles/gitea/templates/docker-compose.yaml.j2 +++ b/playbooks/roles/gitea/templates/docker-compose.yaml.j2 @@ -23,6 +23,10 @@ services: environment: - USER_UID=1000 - USER_GID=1000 + ulimits: + stack: + soft: 16777216 + hard: 9223372036854775807 volumes: - /var/gitea/data:/data - /var/gitea/conf:/custom/conf diff --git a/testinfra/test_gitea.py b/testinfra/test_gitea.py index 7acb3b767b..137d41f39f 100644 --- a/testinfra/test_gitea.py +++ b/testinfra/test_gitea.py @@ -23,3 +23,9 @@ def test_gitea_listening(host): assert gitea_http.is_listening gitea_ssh = host.socket("tcp://0.0.0.0:222") assert gitea_ssh.is_listening + +def test_ulimit(host): + cmd = host.run("docker exec giteadocker_gitea-web_1 prlimit") + expected = ("STACK max stack size " + "16777216 9223372036854775807 bytes") + assert expected in cmd.stdout.split('\n')