WPTIN-23156 Wait for a held JDK download lock instead of failing

This commit is contained in:
Geoff Jacobs
2026-11-09 13:21:33 +11:00
parent 53ce14be0d
commit 70b9b542d9
2 changed files with 17 additions and 9 deletions

View File

@@ -15,4 +15,5 @@ debian_architecture_translations:
debian_architecture: "{{ debian_architecture_translations[ansible_architecture] | default(ansible_architecture) }}"
# path to store jdk download
atl_product_home_shared_download_dir: "{{ atl_shared_mountpoint }}/downloads"
atl_product_home_shared_download_dir: "{{ atl_shared_mountpoint }}/downloads"
atl_jdk_download_lock_timeout: 300

View File

@@ -32,6 +32,9 @@
path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading"
state: directory
register: jdk_downloading_lock
failed_when:
- jdk_downloading_lock is failed
- "'File exists' not in jdk_downloading_lock.msg | default('')"
when:
- jdk_download_completed_lock
- not jdk_download_completed_lock.stat.exists
@@ -69,15 +72,20 @@
- jdk_downloading_lock
- jdk_downloading_lock.changed
# all nodes can wait here in race condition briefly for dl to complete and the downloaded_lock to exist
- name: wait and test 5 times for jdk_download_completed lock to exist
- name: Wait for jdk_downloading lock directory to be released
ansible.builtin.wait_for:
path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading"
state: absent
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
when: not jdk_download_completed_lock.stat.exists
- name: Check if jdk_download_completed lock directory exists after waiting
ansible.builtin.stat:
path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_download_completed"
state: present
timeout: 10
ignore_errors: true
register: jdk_download_completed_lock
retries: 5
# as long as we have a valid rpm filepath do the copy/install block
- block:
@@ -108,8 +116,7 @@
- temurin_file_path is defined
when:
- jdk_download_completed_lock.state is defined
- jdk_download_completed_lock.state == "directory"
- jdk_download_completed_lock.stat.isdir | default(false)
- name: Ensure Eclipse Temurin JDK is present (get from internet if cache install fails or is unavailable)
ansible.builtin.command: