夏恺(Xia Kai)
b33074b703
remove main_q for simplicity.
...
main_q is not used anywhere in the codebase.
It is created in TaskQueueManager._initialize_processes, bundled with rslt_q
into TaskQueueManger._workers, later unwrapped in StrategyBase but not used.
This queue is closed in TaskQueueManger._cleanup_processes.
Historically, it is passed as a init parameter into WorkerProcess,
introduced in 62d7956
, but this behavior is changed in 120b9a7
.
Signed-off-by: 夏恺(Xia Kai) <xiaket@gmail.com>
2016-03-04 07:58:18 +00:00
Brian Coca
5a1887cc76
correctly handle term signals
...
- adhoc now terminates gracefully
- avoid race condition on terminations by ignoring errors if
worker might have been reaped between checking if active and termination call
- ansible-playbook now properly exits on sigint/term
- adhoc and playbook now give exceptions that we should not normally capture
and rely on top level finally to reap children
- handle systemexit breaks in workers
- added debug to see at which frame we exit
partial fix for #14346
2016-02-08 09:51:16 -05:00
Brian Coca
1aae6499ca
fixed code for v1 callback runtime compatiblity
...
old exception code obsoleted by exception avoidance
errors on callback produce warnings and don't stop play
2016-01-29 16:55:23 -05:00
Toshio Kuratomi
f4d68b8860
Transform tracebacks into unicode before printing
...
Fixes #14042
2016-01-25 19:18:59 -08:00
Brian Coca
87fe32319f
ensure stdout callback alwasy is loaded first
...
it is now called for every event prior to any other callbacks
fixes #14114
2016-01-25 17:11:36 -05:00
James Cammarata
abc82fee13
Fix typo in 0b86aa6
2016-01-14 11:57:12 -05:00
James Cammarata
0b86aa62e1
Hack to work around callback API change for v2_playbook_on_start
2016-01-14 11:54:44 -05:00
Brian Coca
737090dd13
now show full callback stacktrace when vvv+
...
Still is a warning as we don't want to repeat it multiple times nor additional callbacks to stop ansible execution.
hopefully we can avoid shipping w/o exceptions in the default/minimal callbacks...
Also added feature that now allows for 'preformated' strings passed to warning
2016-01-08 10:42:12 -05:00
James Cammarata
6312e38133
Fixing up some non-py3 things for unit tests
2015-12-14 10:35:58 -05:00
James Cammarata
120b9a7ac6
Changing the way workers are forked
2015-12-11 23:35:07 -05:00
Charles Paul
6680cc7052
allow custom callbacks with adhoc cli for scripting
...
missing import of CallbackBase
2015-12-10 09:49:54 -05:00
Brian Coca
04d74fd680
reenabled --tree for ansible adhoc command
...
previous fix to avoid callbacks now conflicted with tree optoin
which is implemented as a callback in 2.0
2015-12-09 10:13:50 -08:00
Brian Coca
7936a4687e
adhoc avoids callbacks by default as it did before
...
Previous emptying of whitelist only affected callbacks that were
constructed for need whitelist. This now works for all callbacks.
2015-12-09 10:01:21 -08:00
James Cammarata
a183972477
Don't use play vars in HostVars
...
Fixes #13398
2015-12-02 14:16:47 -05:00
Yannig Perré
5227c6bb52
Do not copy variable_manager each time. Instead, keep host and local variable_manager sync.
...
Fix https://github.com/ansible/ansible/issues/13221
2015-11-28 14:58:33 +01:00
James Cammarata
9f31c073fe
Fixing a few bugs in the HostVars performance areas
...
* Also refresh inventory in the HostVars manager process when things
are changed via add_host/group_by
* Raise j2undefined rather than return it
2015-11-17 09:15:10 -05:00
James Cammarata
5cbeab5a3c
Performance improvements for HostVars and some bugfixes
2015-11-16 17:15:52 -05:00
Toshio Kuratomi
62979efa14
Finish up plugin porting to global display
...
Also remove display = display which does nothing
2015-11-11 10:44:23 -08:00
Toshio Kuratomi
318bfbb207
Migrate cli and dependencies to use global display
2015-11-11 10:44:22 -08:00
Toshio Kuratomi
4737305837
Remove dead code as this was moved to another class
2015-11-10 12:18:20 -08:00
James Cammarata
59b67a2f68
Reset workers list when recreating processes
...
Also renames some things to be more accurate
2015-11-06 12:10:15 -05:00
Brian Coca
9c24f88eca
updated forks comment
2015-11-06 08:31:56 -05:00
James Cammarata
1027abd596
Cleaning up bugs related to perf improvement changes
2015-11-05 16:42:12 -05:00
James Cammarata
63c47fb271
Fixing up performance
2015-11-05 16:22:37 -05:00
Brian Coca
f4912dd88a
added callback fallback to v1 methods for backwards compat with existing callbacks
2015-11-05 13:04:50 -05:00
Brian Coca
e2c56efca6
Merge pull request #12867 from bcoca/callback_whitelist_tweak
...
make callbacks declare needing whitelisting
2015-11-05 12:58:05 -05:00
Brian Coca
931eb16e55
clearer selection of min value
...
cleanup workers at each run to avoid stragglers
2015-11-04 17:28:08 -05:00
Brian Coca
b44f1428d0
use minimal number of forks taking serial, forks and play patterns into account
2015-11-04 15:16:20 -05:00
Brian Coca
3c35655b52
removed serial as it is not avialable for fork control
...
fixes #13037
2015-11-04 14:04:47 -05:00
Brian Coca
0abeff4511
better limiting of forks to lowest actual restriction
2015-11-04 12:47:10 -05:00
Lars Larsson
3289670a04
treat forks config parameter as max value instead of always creating that number of workers
2015-11-04 17:13:26 +01:00
Brian Coca
5017a96948
Revert "make callbacks declare needing whitelisting"
...
another premature merge
This reverts commit df8ff85787
.
2015-10-22 16:34:51 -04:00
Brian Coca
df8ff85787
make callbacks declare needing whitelisting
...
this will allow for custom or v1 callbacks locally loaded to automatically be triggered as they were in 1.x
2015-10-22 12:30:23 -04:00
Brian Coca
c267c23020
make callbacks declare needing whitelisting
...
this will allow for custom or v1 callbacks locally loaded to automatically be triggered as they were in 1.x
2015-10-22 08:27:32 -04:00
James Cammarata
deff045aa9
Fix bug caused by options not having start_at_task when used through adhoc
...
Fixes #12590
2015-10-01 10:09:58 -04:00
James Cammarata
dcb8caf9e8
Remember if we already skipped tasks via --start-at-task
...
Fixes #12482
2015-09-30 14:12:38 -04:00
James Cammarata
be7bd392cb
Fix unreachable host detection and have plays continue after unreachable failures
...
Fixes #12284
2015-09-09 15:27:26 -04:00
James Cammarata
4ac2bafc4b
Set hosts fact gathering flag based on fact cache entries
...
Fixes #12213
2015-09-03 14:11:19 -04:00
James Cammarata
9e1bc434c7
Further cleanup from locking changes
2015-09-03 01:07:29 -04:00
James Cammarata
b93f27e260
Move the lockfile back to tqm to make sure it stays unique
2015-09-03 00:45:42 -04:00
James Cammarata
50448d68e1
Implement max_fail_percentage and any_errors_fatal support
...
Fixes #11997
2015-08-26 12:03:47 -04:00
Brian Coca
154754ae50
pushed module_loader to task_queue_manager so all cli's can benefit from it
...
also normalized -M option across all cli
fixes #12016
2015-08-25 18:14:03 -04:00
Brian Coca
851ed45bbf
adding display to plugins and start moving debug to display
2015-07-23 10:26:12 -04:00
James Cammarata
4c733fe4b7
Fix issues with vars_prompt and vars_files
...
* Prompt had to be moved up, as it needed to be done before the first
templating of the play occurs, otherwise vars_files won't be templated
properly
* Fixed a bug related to an earlier fix of vars_files incorporating
extra vars to do the templating of the file name
Fixes #11404
2015-07-21 14:52:57 -04:00
James Cammarata
e64989beb4
Moving ConnectionInformation -> PlayContext
...
Also making PlayContext a child class of the Playbook Base class,
which gives it access to all of the FieldAttribute code to ensure
field values are correctly typed after post_validation
Fixes #11381
2015-07-21 12:13:50 -04:00
Brian Coca
a09f44210e
now callback errors are not silent but warnings
2015-07-13 19:23:27 -04:00
Brian Coca
a918a1bd16
now calls correct v2_on_any callback method
2015-07-10 10:30:33 -04:00
James Cammarata
67671e328a
Fix callback loading issue a slightly different way
2015-07-04 00:07:17 -04:00
James Cammarata
a51c165157
Revert "load callbacks on init again as they did not seem to load with new call from executor"
...
This reverts commit cf4ed9a556
.
2015-07-03 23:52:59 -04:00
Brian Coca
cf4ed9a556
load callbacks on init again as they did not seem to load with new call from executor
2015-07-03 13:01:21 -04:00