mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix a race condition in manage runner
The runner was not connecting the client event listener to the event bus. This meant that all events between the `client.run_job()` and when `client.get_cli_event_returns()` began polling for events would be lost. Before `get_cli_event_returns` (via LocalClient's `get_iter_returns`) gets around to polling for events, it first checks to see if the job cache has a record of the jid it's querying. When using a custom returner for the job_cache, one which has even a little bit of latency, return events from minions may sneak past before the jid lookup is complete, meaning that `get_iter_returns` will not return them and the manage runner will assume the minion did not respond. Connecting to the event bus before we run the test.ping ensures that we do not miss any of these events.
This commit is contained in:
parent
e8e3b3c8ff
commit
2ac70cfab5
1 changed files with 1 additions and 0 deletions
|
@ -37,6 +37,7 @@ log = logging.getLogger(__name__)
|
|||
|
||||
def _ping(tgt, tgt_type, timeout, gather_job_timeout):
|
||||
client = salt.client.get_local_client(__opts__['conf_file'])
|
||||
client.event.connect_pub(timeout=timeout)
|
||||
pub_data = client.run_job(tgt, 'test.ping', (), tgt_type, '', timeout, '')
|
||||
|
||||
if not pub_data:
|
||||
|
|
Loading…
Add table
Reference in a new issue