Comments (4)
This is more likely a Heroku issue you need to bring up with Heroku Support. They may have better logs to identify the issue. Maybe start a Stack Overflow thread as well to get a wider response from the online community.
Depending on your plan with Heroku, you may be able to get them to assist with the restart of the dyno or you can create your own trigger to restart dynos daily as depending on your plan, they may have moved your DB during that period which caused the issue. I have experienced this before and as we were on a Hobby plan, they did not help us, so we added our own restart task daily so that we work on our timezones and not theirs. (Add Heroku Schedular and add a task "heroku ps:restart --app xxxxx")
rack-timeout threw the error, Rack::Timeout::RequestTimeoutException:, which confirms it caught it, but it could be your worker thread or any other puma or background task kept on retrying or attempting to complete the task but due to DB connectivity could not commit the transaction or query.
from rack-timeout.
@collimarco Please consider the options that have been suggested in #49 ( statement_timeout
, RACK_TIMEOUT_TERM_ON_TIMEOUT
)
from rack-timeout.
Without term on timeout, not only connections but also almost every code can be broken completely.
I described the detail in #169 and am proposing to set term on timeout by default.
from rack-timeout.
Is there any way to fix this inside this gem?
No, but you can use the "TERM on timeout" feature.
Should we report this to Rails / ActiveRecord? Why the connection was not healed automatically after some time?
It's been reported but it's not considered something they can fix. You can opt out of using prepared statements (and this is actually recommended by Heroku to turn this off) which does avoid this particular issue but you can still run into cases where the connection can enter a bad state.
Is there any way to tell Heroku to restart the dyno in this case (when it detects high rates of 500 errors)?
No -- there's infinite causes for a 500 and while restarting might work in some cases, the solution most apps use here would be to monitor the 500 rate to page a human to address the root cause of the 500s.
from rack-timeout.
Related Issues (20)
- Improve rack-timeout docs to map raised exceptions to desired status code HOT 11
- Request still running/completing after timeout? HOT 5
- Proposal to deprecate `term_on_timeout: false` HOT 7
- Detect if the middleware is already loaded and prevent it from being loaded twice HOT 9
- Unicorn graceful shutdown seems incompatible with `TERM` usage HOT 4
- Push 0.6.1 to Rubygems HOT 4
- Prefer sending SIGKILL over SIGTERM to a process HOT 2
- is "active" observer turned off for non-debug? HOT 5
- PR needed/wanted: Incompatibility with Ruby on Windows HOT 1
- [Feature Request] Optionally notify observers only HOT 4
- Request: timeout exempt requests HOT 1
- problem with unicorn graceful restart HOT 2
- possibility to timeout only for GET requests ? HOT 1
- Puma and rack-timeout results in a null pointer after running for some time HOT 1
- Disable logging HOT 4
- ArgumentError: wrong number of arguments (given 2, expected 1) with Ruby 3.2.2 and Rails 6.1.4 HOT 2
- Question: RACK_TIMEOUT_TERM_ON_TIMEOUT on one cluster HOT 1
- RACK_TIMEOUT_TERM_ON_TIMEOUT=0 still does not allow TruffleRuby to run HOT 2
- Dynamic service_timeout HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rack-timeout.