Skip to content

Commit 9fafc13

Browse files
committed
Enhance kill process execution with retries and error handling in kill-enqueue-replication.yml
1 parent 9f2a69d commit 9fafc13

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/roles/ha_scs/tasks/kill-enqueue-replication.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,29 @@
3434
test_execution_hostname: "{{ hostvars[cluster_status_pre.ers_node].ansible_hostname }}"
3535

3636
- name: "Test Execution: Check for ENSA version"
37-
ansible.builtin.shell: pgrep -f "enqr.sap{{ sap_sid | upper }}" | wc -l
37+
ansible.builtin.shell: pgrep -f 'enqr.sap{{ sap_sid | upper }}' | wc -l
3838
register: ensa2_check
3939
failed_when: false
4040

4141
- name: "Test Execution: Kill Enqueue Replication Server Process (ENSA1)"
42-
ansible.builtin.shell: pgrep -f "er.sap{{ sap_sid | upper }}" | xargs kill -9
42+
ansible.builtin.shell: pgrep -f 'er.sap{{ sap_sid | upper }}' | xargs kill -9
4343
register: kill_er_result
4444
failed_when: false
4545
when: ensa2_check.stdout == "0"
46+
until: "'kill: not enough arguments' in kill_er_result.stderr"
47+
ignore_errors: true
48+
retries: 10
49+
delay: 1
4650

4751
- name: "Test Execution: Kill Enqueue Replication Server Process (ENSA2)"
48-
ansible.builtin.shell: pgrep -f "enqr.sap{{ sap_sid | upper }}" | xargs kill -9
52+
ansible.builtin.shell: pgrep -f 'enqr.sap{{ sap_sid | upper }}' | xargs kill -9
4953
register: kill_enqr_result
5054
failed_when: false
5155
when: ensa2_check.stdout != "0"
56+
until: "'kill: not enough arguments' in kill_enqr_result.stderr"
57+
ignore_errors: true
58+
retries: 10
59+
delay: 1
5260

5361
- name: "Test Execution: Wait for Process Restart"
5462
ansible.builtin.pause:

0 commit comments

Comments
 (0)