Skip to content
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

[close #131] Retry App#run on empty results #132

Merged
merged 2 commits into from
Sep 22, 2020
Merged

Conversation

schneems
Copy link
Contributor

@schneems schneems commented Sep 18, 2020

App#run (heroku run) commands sometimes return empty strings. We would love to know WHY so this pr does two things:

  • Adds debugging information when this happens
  • Retries the commands by default up to 3 times

I figure that it's unlikely someone will be running a heroku run session and expecting an empty result, unless that's how they detect some failure mode. If they are expecting it, then they can manually specify retry_on_empty: false.

For now the only extra debug info we're providing is the contents of releases. In the future we could enable DEBUG="*" by default and separately capture stdout versus stderr and output the full debug contents of stderr if needed.

In reality, the retry behavior here will likely be "good enough" to make this issue functionally disappear.

I extracted the behavior of running a heroku run command to it's own class to make unit testing easier and because app.rb is becoming a junk drawer of private methods.

@schneems schneems force-pushed the schneems/empty-run branch 2 times, most recently from 53cd8e2 to d760eee Compare September 18, 2020 19:22
App#run (`heroku run`) commands sometimes return empty strings. We would love to know WHY so this pr does two things:

- Adds debugging information when this happens
- Retries the commands by default up to 3 times

I figure that it's unlikely someone will be running a `heroku run` session and expecting an empty result, unless that's how they detect some failure mode. If they are expecting it, then they can manually specify `retry_on_empty: false`.

For now the only extra debug info we're providing is the contents of releases. In the future we could enable `DEBUG="*"` by default and separately capture stdout versus stderr and output the full debug contents of stderr if needed.

In reality, the retry behavior here will likely be "good enough" to make this issue functionally disappear.

I extracted the behavior of running a `heroku run` command to it's own class to make unit testing easier and because app.rb is becoming a junk drawer of private methods.
@schneems schneems merged commit be69f28 into main Sep 22, 2020
@schneems schneems deleted the schneems/empty-run branch September 22, 2020 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant