-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add exponential retry on fetch #60
Conversation
PR fails due to missing dependency -backoff module. |
Hi @go-dima The issue seems to be that Ansible is requiring the import in a try/except block. |
plugins/lookup/conjur_variable.py
Outdated
@@ -97,6 +97,7 @@ | |||
from stat import S_IRUSR, S_IWUSR | |||
from tempfile import gettempdir, NamedTemporaryFile | |||
import yaml | |||
import backoff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a try/except block as described in https://docs.ansible.com/ansible/devel/dev_guide/testing/sanity/import.html
try:
import backoff
except ImportError as imp_exc:
BACKOFF_IMPORT_ERROR = imp_exc
else:
BACKOFF_IMPORT_ERROR = None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take a look. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpothier, Same result. It looks like the module isn't found, although it is supported officially.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm looking into it also. When you say it's officially supported, do you mean by python? or Ansible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @go-dima I did some research with Ansible and it looks like they do not support non standard libraries.
Ansible has ansible.module_utils.api.retry
can you use that instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like ansible retry doesn't fit - it expects an exception to identify failure for retry. I'll keep looking for a suitable solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpothier
I decided to implement it myself, care to tae a look?
I also need an approval to run workflows now :)
@rpothier |
Thanks for the update! I'll wait for #61 and update this one. |
@rpothier can you re-trigger the build please? (I don't have permissions) |
@go-dima Did you rebase with the latest? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you summarize the testing that was done to validate this?
@go-dima Woohoo! tests all pass. Changes look good. |
@rpothier Regarding the tests: I don't have a proper way to make sure that the retry happens during the plugin (since I cannot force 500 reply), but I did test the code in a standalone scenario with a simulated 500 error. Regarding the squash - I plan to perform the merge itself with 'squash and merge' option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@rpothier |
@go-dima Can you sign off your commit ? https://github.com/cyberark/community/blob/master/CONTRIBUTING.md#signing-off-a-commit |
@rpothier Done |
Implement custom retry decorator Signed-off-by: Dima Gonikman <dima.gonikman@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this PR do?