-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execution engine not backward compatible in 2.0 #15395
Comments
An updated set of patches can be seen in this diff: stable-2.0...vroy:backward-compatible-executor I believe that it fixes most backward compatibility issues with 1.9. |
The diff above appears to help with an issue I recently logged - #15523 There's an improvement in behaviour where all hosts are unreachable. Without patch all unreachable -
With the patch all unreachable -
It doesn't seem to help when only a subset of the hosts are unreachable however. Without the patch subset unreachable -
With the patch subset unreachable -
|
@vroy I'm looking at merging these for 2.1 and would like you to share any sample playbooks you may have. I was going to tackle preserving the failed hosts from the iterator as I mentioned directly on the commit earlier. |
@vroy created a feature branch (above) against devel with your patches and one fix of my own which actually removes the check on failed hosts when compiling the list of active hosts in the linear strategy (so no need to use the iterator there at all). Could you please test this against your reproducers and let me know if the issues are still resolved? I'll also be checking #15523, #13750, and #14665 to see if they're resolved. |
Oops, the link above is just for the last commit, the branch is here: https://github.com/ansible/ansible/compare/vroy_backward-compatible-executor |
@jimi-c Thanks for looking into this. I have a lot of test playbooks but unfortunately they're tied in our test framework at the moment. It might be a little longer until I can make this easily reproducible. I've tried your branch and am still seeing hosts being included in future plays: https://gist.github.com/vroy/db8d2bfa18e249b79947a540ce128720 I've tried with my patch against 2.0.1.0 and it's behaving the same as 1.9.5. |
That's really odd, because my version of your branch didn't add anything other than to remove the check on failed hosts within the linear strategy, which shouldn't affect future plays. |
@vroy I just pushed an additional commit to that branch which makes your example gist function as expected. |
Just to follow up, it looks like all three of those issues are resolved by this branch in my testing. |
I'll run your updated branch against my little test suite again tomorrow morning and let you know how it turns out. |
I'm still seeing some issues around how max_fail_percentage is handled: https://gist.github.com/vroy/4c0d7ced6e73a39b6f4ae2d18c293c15 This was using your updated branch:
|
Ok, that one is an odd corner-case, so I feel good about merging this work in now for 2.1 rc3 (which we're aiming to release today). I'll continue looking into the max fail % issue above as well. |
@vroy the max_fail_pct thing should be fixed in devel/stable-2.1 as well (tested against your gist above). # ansible-playbook -vv -i inv max_fail_percentage_does_not_affect_future_plays.yml Using /etc/ansible/ansible.cfg as config file PLAYBOOK: max_fail_percentage_does_not_affect_future_plays.yml ***************** 3 plays in max_fail_percentage_does_not_affect_future_plays.yml PLAY [Fail on first host] ****************************************************** TASK [setup] ******************************************************************* ok: [host3] ok: [host4] ok: [host1] ok: [host2] TASK [Fail on first host] ****************************************************** task path: /root/testing/15395/max_fail_percentage_does_not_affect_future_plays.yml:4 fatal: [host1]: FAILED! => {"changed": false, "failed": true, "msg": "Halting"} skipping: [host2] => {"changed": false, "skip_reason": "Conditional check failed", "skipped": true} skipping: [host3] => {"changed": false, "skip_reason": "Conditional check failed", "skipped": true} skipping: [host4] => {"changed": false, "skip_reason": "Conditional check failed", "skipped": true} TASK [Will not run on first host] ********************************************** task path: /root/testing/15395/max_fail_percentage_does_not_affect_future_plays.yml:7 changed: [host4] => {"changed": true, "cmd": ["echo", "should not run on first host"], "delta": "0:00:00.003134", "end": "2016-05-18 14:10:07.782730", "rc": 0, "start": "2016-05-18 14:10:07.779596", "stderr": "", "stdout": "should not run on first host", "stdout_lines": ["should not run on first host"], "warnings": []} changed: [host2] => {"changed": true, "cmd": ["echo", "should not run on first host"], "delta": "0:00:00.003843", "end": "2016-05-18 14:10:07.787135", "rc": 0, "start": "2016-05-18 14:10:07.783292", "stderr": "", "stdout": "should not run on first host", "stdout_lines": ["should not run on first host"], "warnings": []} changed: [host3] => {"changed": true, "cmd": ["echo", "should not run on first host"], "delta": "0:00:00.004004", "end": "2016-05-18 14:10:07.789357", "rc": 0, "start": "2016-05-18 14:10:07.785353", "stderr": "", "stdout": "should not run on first host", "stdout_lines": ["should not run on first host"], "warnings": []} NO MORE HOSTS LEFT ************************************************************* PLAY [Continues running] ******************************************************* TASK [setup] ******************************************************************* ok: [host2] ok: [host4] ok: [host3] TASK [command] ***************************************************************** task path: /root/testing/15395/max_fail_percentage_does_not_affect_future_plays.yml:14 changed: [host3] => {"changed": true, "cmd": ["echo", "Continuing"], "delta": "0:00:00.003061", "end": "2016-05-18 14:10:11.182399", "rc": 0, "start": "2016-05-18 14:10:11.179338", "stderr": "", "stdout": "Continuing", "stdout_lines": ["Continuing"], "warnings": []} changed: [host4] => {"changed": true, "cmd": ["echo", "Continuing"], "delta": "0:00:00.003795", "end": "2016-05-18 14:10:11.186598", "rc": 0, "start": "2016-05-18 14:10:11.182803", "stderr": "", "stdout": "Continuing", "stdout_lines": ["Continuing"], "warnings": []} changed: [host2] => {"changed": true, "cmd": ["echo", "Continuing"], "delta": "0:00:00.003885", "end": "2016-05-18 14:10:11.187053", "rc": 0, "start": "2016-05-18 14:10:11.183168", "stderr": "", "stdout": "Continuing", "stdout_lines": ["Continuing"], "warnings": []} NO MORE HOSTS LEFT ************************************************************* PLAY [Continues running some more] ********************************************* TASK [setup] ******************************************************************* ok: [host2] ok: [host4] ok: [host3] TASK [command] ***************************************************************** task path: /root/testing/15395/max_fail_percentage_does_not_affect_future_plays.yml:19 changed: [host2] => {"changed": true, "cmd": ["echo", "Continuing"], "delta": "0:00:00.006797", "end": "2016-05-18 14:10:14.449458", "rc": 0, "start": "2016-05-18 14:10:14.442661", "stderr": "", "stdout": "Continuing", "stdout_lines": ["Continuing"], "warnings": []} changed: [host3] => {"changed": true, "cmd": ["echo", "Continuing"], "delta": "0:00:00.007048", "end": "2016-05-18 14:10:14.465126", "rc": 0, "start": "2016-05-18 14:10:14.458078", "stderr": "", "stdout": "Continuing", "stdout_lines": ["Continuing"], "warnings": []} changed: [host4] => {"changed": true, "cmd": ["echo", "Continuing"], "delta": "0:00:00.006773", "end": "2016-05-18 14:10:14.466279", "rc": 0, "start": "2016-05-18 14:10:14.459506", "stderr": "", "stdout": "Continuing", "stdout_lines": ["Continuing"], "warnings": []} NO MORE HOSTS LEFT ************************************************************* PLAY RECAP ********************************************************************* host1 : ok=1 changed=0 unreachable=0 failed=1 host2 : ok=6 changed=3 unreachable=0 failed=0 host3 : ok=6 changed=3 unreachable=0 failed=0 host4 : ok=6 changed=3 unreachable=0 failed=0 |
@jimi-c Confirmed. All of my reproducers are passing against the devel branch. Thanks again for looking into this! |
No problem, thank you for the excellent testing! |
ISSUE TYPE
ANSIBLE VERSION
Used for actual results:
Used for expected results:
SUMMARY
We've recently upgraded from ansible 1.9.5 to 2.0.1.0 with much success but we ran into issues where failures are not handled as expected:
If
any_errors_fatal
is true and there's an unreachable host, task errors will be ignored: https://gist.github.com/vroy/e98bd1c552d9a7633ca0fda88a9176c5Hosts that failed are removed from the current play but restored in the next play: https://gist.github.com/vroy/4b877a7bc9bb996de96a862e82b98e62
PATCH
I'm submitting this as a bug first to get some feedback before opening a pull request. Please let me know if you have any questions or if there's anything I can do to help.
I've been working on a patch (against 2.0.1.0 simply because that's what we use in production) that resolves these two issues: vroy@63471cd
The results after my patch is applied were included in the gists and doesn't seem to cause issues with some of our other happy path playbooks that we use for testing.
One thing to note is that even with my patch, we see more plays being logged though they are not running any tasks as expected. I think this could be improved.
The text was updated successfully, but these errors were encountered: