Skip to content

Non-recursive failure handling in HttpClient.exec()#95

Closed
theoreticalbts wants to merge 1 commit intomasterfrom
2017-10-30-iterative-failure
Closed

Non-recursive failure handling in HttpClient.exec()#95
theoreticalbts wants to merge 1 commit intomasterfrom
2017-10-30-iterative-failure

Conversation

@theoreticalbts
Copy link
Copy Markdown
Contributor

This PR fixes a bug where occasionally steem-python will revert to positional argument passing when RPC methods are called with keyword arguments. The bug occurs when retrying after a failure of the server RPC connection. The existing implementation has a recursive tail call to exec but PR #86 did not update the tail call to forward the new kwargs argument.

This patch refactors the recursive tail call to use a loop instead, which has the following desirable properties:

  • Fixes the above-described bug
  • n successive connection failures do not consume n stack frames

Adding ?w=1 to the URL to suppress whitespace will make this pull request easier to review, this patch is like a textbook example of replacing recursion with iteration.

@roadscape
Copy link
Copy Markdown
Contributor

Thanks for the ?w=1 tip, that's incredibly useful. Closing this PR; your change will be implemented in #202.

@roadscape roadscape closed this Apr 3, 2018
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.

4 participants