Skip to content

Instantly share code, notes, and snippets.

@jpic
Last active January 7, 2016 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpic/8a94155f4b333de272fd to your computer and use it in GitHub Desktop.
Save jpic/8a94155f4b333de272fd to your computer and use it in GitHub Desktop.
Fix a race condition between the reactor and salt-call
@@ -248,7 +248,12 @@ salt_call() {
loglevel="-l debug"
fi
- salt-call $color --state-output=mixed --retcode-passthrough $loglevel $@
+ local call="salt-call $color --state-output=mixed --retcode-passthrough $loglevel"
+
+ # This feature prevents race conditions ie. reactor started a job and it
+ # has to finish before we can call a state function.
+ retry $call state.show_sls test
+ $call $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment