From 973740dea840e8bc36d1a213f80c69ec30d8fb18 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Mon, 9 Nov 2026 13:36:36 +1100 Subject: [PATCH] WPTIN-23156 Take over stale JDK download locks and fall back on wait timeout --- roles/product_common/tasks/amazon-2023.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index e28147b..6496ed1 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -27,6 +27,19 @@ path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_download_completed" register: jdk_download_completed_lock + - name: Check if jdk_downloading lock directory exists + ansible.builtin.stat: + path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading" + register: jdk_downloading_lock_stat + + - name: Remove stale jdk_downloading lock directory + ansible.builtin.file: + path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading" + state: absent + when: + - jdk_downloading_lock_stat.stat.exists + - now().timestamp() - jdk_downloading_lock_stat.stat.mtime > atl_jdk_download_lock_timeout | int + - name: create jdk_downloading lock directory ansible.builtin.file: path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading" @@ -79,7 +92,8 @@ timeout: "{{ atl_jdk_download_lock_timeout }}" msg: >- {{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading - still exists after {{ atl_jdk_download_lock_timeout }}s; remove it if no node is downloading the JDK + still exists after {{ atl_jdk_download_lock_timeout }}s; installing the JDK without the shared download cache + ignore_errors: true when: not jdk_download_completed_lock.stat.exists - name: Check if jdk_download_completed lock directory exists after waiting