mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2026-11-28 03:10:46 -06:00
WPTIN-23156 Wait for a held JDK download lock instead of failing
This commit is contained in:
@@ -16,3 +16,4 @@ debian_architecture_translations:
|
|||||||
debian_architecture: "{{ debian_architecture_translations[ansible_architecture] | default(ansible_architecture) }}"
|
debian_architecture: "{{ debian_architecture_translations[ansible_architecture] | default(ansible_architecture) }}"
|
||||||
# path to store jdk download
|
# 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
|
||||||
|
|||||||
@@ -32,6 +32,9 @@
|
|||||||
path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading"
|
path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading"
|
||||||
state: directory
|
state: directory
|
||||||
register: jdk_downloading_lock
|
register: jdk_downloading_lock
|
||||||
|
failed_when:
|
||||||
|
- jdk_downloading_lock is failed
|
||||||
|
- "'File exists' not in jdk_downloading_lock.msg | default('')"
|
||||||
when:
|
when:
|
||||||
- jdk_download_completed_lock
|
- jdk_download_completed_lock
|
||||||
- not jdk_download_completed_lock.stat.exists
|
- not jdk_download_completed_lock.stat.exists
|
||||||
@@ -69,15 +72,20 @@
|
|||||||
- jdk_downloading_lock
|
- jdk_downloading_lock
|
||||||
- jdk_downloading_lock.changed
|
- 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 for jdk_downloading lock directory to be released
|
||||||
- name: wait and test 5 times for jdk_download_completed lock to exist
|
|
||||||
ansible.builtin.wait_for:
|
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"
|
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
|
register: jdk_download_completed_lock
|
||||||
retries: 5
|
|
||||||
|
|
||||||
# as long as we have a valid rpm filepath do the copy/install block
|
# as long as we have a valid rpm filepath do the copy/install block
|
||||||
- block:
|
- block:
|
||||||
@@ -108,8 +116,7 @@
|
|||||||
- temurin_file_path is defined
|
- temurin_file_path is defined
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- jdk_download_completed_lock.state is defined
|
- jdk_download_completed_lock.stat.isdir | default(false)
|
||||||
- jdk_download_completed_lock.state == "directory"
|
|
||||||
|
|
||||||
- name: Ensure Eclipse Temurin JDK is present (get from internet if cache install fails or is unavailable)
|
- name: Ensure Eclipse Temurin JDK is present (get from internet if cache install fails or is unavailable)
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
|
|||||||
Reference in New Issue
Block a user