Comments (2)
@bemurphy Sure thing.
You specify an app restart post migration. We have issues sometimes I call "stuck dynos" where sometimes not every process seems to be aware of new columns. Is this to alleviate that, or is there another reason?
Yes, it is to alleviate that.
When a Rails app boots, the ActiveRecord classes reflect on the database to determine which attributes and associations to add to the models:
http://guides.rubyonrails.org/configuring.html#rails-general-configuration
The config.cache_classes
setting is true
in production mode and false
in development mode. During development, we can write and run a migration and see the change take effect without restarting the web server but in production we need to restart the server for the ActiveRecord classes to learn about the new information from the database. Otherwise, the database will have the column but the ActiveRecord classes will have been cached based on the old information.
When you introspect to make sure "everything is ok" what do you look for?
Here's a real example:
production ps
=== web: `bundle exec rails server thin start -p $PORT -e $RACK_ENV`
web.1: up 2013/01/25 16:33:07 (~ 18h ago)
web.2: up 2013/01/25 16:47:15 (~ 18h ago)
=== worker: `bundle exec rake jobs:work`
worker.1: up 2013/01/25 17:30:58 (~ 17h ago)
The "up"s tell me the processes are running. They will say "crashed" if there's a problem.
If I were to run production tail
(aliases from here), I might just be watching the stream looking for anything unusual, like 500s and errors. Sometimes error reporting services are delayed so there's no faster way to know about a post-deploy issue than tailing the logs while running through some critical workflows in the app. If something looks unusual, I might then move over to the logging service we have set up (typically Splunk or Papertrail) to run some searches to see how often the problem is coming up or if it looks new post-deploy. New Relic or Airbrake will likely have more backtrace information by this time and we can make a decision about whether to roll back the deploy, or work on a hotfix as the next action, or record the bug and place it lower in the backlog.
from guides.
@croaky wow, thanks so much for this answer. It just highlighted a problem in our deploy task I can't believe I didn't think of before! You should see the look on my face.
from guides.
Related Issues (20)
- Add accessibility resources to guides HOT 8
- YouTube Video Unavailable HOT 5
- Should we delete empty (seemingly duplicate) graphql guide? HOT 1
- Document SVG best practices HOT 5
- Update Backbone guide? HOT 2
- Update Ember guide? HOT 1
- Update how-to guide on feature-testing a Rails app’s Javascript? HOT 2
- Document Go Best Practices HOT 2
- Replace Ruby style guide with standard HOT 2
- Combine Best Practices and Style guides HOT 3
- Our testing guides are ruby/rails-centric HOT 2
- What layout should we suggest for test suite files in JavaScript / TypeScript projects?
- Audit guides for potential improvements
- Guides have inconsistent formatting
- Data guide should use description lists HOT 4
- Change master to main in thoughtbot/guides HOT 4
- Inquiring about JSONB column issues HOT 2
- rebase workflow link missing from Git guide HOT 1
- 404 link in relational-databases
- A11y template 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 guides.