Skip to content

Fix a number of issues with pr253#258

Merged
mergify[bot] merged 6 commits intojd:masterfrom
asqui:fix-issues-with-pr253
Oct 22, 2020
Merged

Fix a number of issues with pr253#258
mergify[bot] merged 6 commits intojd:masterfrom
asqui:fix-issues-with-pr253

Conversation

@asqui
Copy link
Copy Markdown
Contributor

@asqui asqui commented Oct 20, 2020

  1. Add test coverage for Retrying.__call__() interface to demonstrate a number of issues with the changes from Make AsyncRetrying callable (as Retrying class) #253
  2. Fix the issues with the backward compatibility Retrynig.call() method:-
  • It calls self.__call__(self, ...) i.e. passing itself, the Retrying instance, as the function to call. Now that Retrying is callable, this sneaks in and leads to reentrant invocation of the same Retrying object (is that even supported?) and, ultimately nested retrying. Uber-badness; not caught by any existing tests! :-o
  • It doesn't return the result.
  • It raises a UserWarning rather than DeprecationWarning type (which is what other parts of the code use for backward compatibility shims)

This PR contains a number of commits that can and probably should be squashed into a single commit after review. Let me know if you want me to do this (I don't know how easy GitHub makes it for you to do this at merge-time, whilst letting you compose a sensible commit message).

Comment thread tenacity/__init__.py
"Use 'Retrying.__call__()' instead")
self.__call__(self, *args, **kwargs)
"Use 'Retrying.__call__()' instead", DeprecationWarning)
return self.__call__(*args, **kwargs)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ops, what a big miss. Thank you for finding this!

@mergify mergify Bot merged commit d66af82 into jd:master Oct 22, 2020
@asqui asqui deleted the fix-issues-with-pr253 branch October 22, 2020 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants