From 65991cf92eba9f22e246acba0fb39deca1a860b4 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 16 Jun 2021 11:47:52 +1000 Subject: [PATCH] openafs-client: add service timeout override Starting the openafs-client service is an intensive operation as it walks the cache registering various things. We've seen on our production ARM64 mirror this can take longer than the 1:30 default timeout. This is a fatal issue, as the module will try to unload while afsd is still spinning and working resulting in completely corrupt kernel state. This is about double the longest time we've seen, so should give plenty of overhead. Change-Id: I37186494b9afd72eab3a092279579f1a5fa5d22c --- roles/openafs-client/README.rst | 7 +++++++ roles/openafs-client/defaults/main.yaml | 3 ++- roles/openafs-client/tasks/main.yaml | 17 +++++++++++++++++ roles/openafs-client/templates/timeout.conf.j2 | 2 ++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 roles/openafs-client/templates/timeout.conf.j2 diff --git a/roles/openafs-client/README.rst b/roles/openafs-client/README.rst index 11556a921b..5934709ef5 100644 --- a/roles/openafs-client/README.rst +++ b/roles/openafs-client/README.rst @@ -43,3 +43,10 @@ role has limited platform support. Currently supported are :default: no Enable or disable gpg checking for ``openafs_yum_repo_url`` + +.. zuul:rolevar:: openafs_client_service_timeout_sec + :default: 480 + + The TimeoutSec for service start. Accounting for the cache + during startup can cause a high load which may necessitate + a longer startup timeout on some platforms. diff --git a/roles/openafs-client/defaults/main.yaml b/roles/openafs-client/defaults/main.yaml index 248bfcf8f5..4109dd3e1f 100644 --- a/roles/openafs-client/defaults/main.yaml +++ b/roles/openafs-client/defaults/main.yaml @@ -1,3 +1,4 @@ openafs_client_cell: 'openstack.org' openafs_client_cache_directory: '/var/cache/openafs' -openafs_client_cache_size: 500000 \ No newline at end of file +openafs_client_cache_size: 500000 +openafs_client_service_timeout_sec: 480 diff --git a/roles/openafs-client/tasks/main.yaml b/roles/openafs-client/tasks/main.yaml index ef9ac34120..6ed5412f7c 100644 --- a/roles/openafs-client/tasks/main.yaml +++ b/roles/openafs-client/tasks/main.yaml @@ -62,6 +62,23 @@ mode: 0700 become: yes +- name: Set timeout override + become: yes + block: + - name: Create service override directory + file: + path: '/etc/systemd/system/openafs-client.service.d' + state: directory + owner: root + group: root + mode: 0755 + - name: Save override + template: + dest: '/etc/systemd/system/openafs-client.service.d/timeout.conf' + src: 'timeout.conf.j2' + group: root + mode: 0644 + - name: Setup OS specific openafs-client environment include_tasks: "{{ lookup('first_found', params) }}" vars: diff --git a/roles/openafs-client/templates/timeout.conf.j2 b/roles/openafs-client/templates/timeout.conf.j2 new file mode 100644 index 0000000000..846ad410b0 --- /dev/null +++ b/roles/openafs-client/templates/timeout.conf.j2 @@ -0,0 +1,2 @@ +[Service] +TimeoutSec={{ openafs_client_service_timeout_sec }}