Code cannot be updated while the application is running
We aim to hit zero-downtime deploys with GitLab, but this is made difficult by the code loading strategy employed by rails.
During upgrade, we change files on disk while the process is still running based on the old files. When the running process consults the updated files - especially when they're code files - various bad things can happen.
We eager load most code, but Rails view files, in particular, can still be loaded from disk while the upgrade is ongoing.
A safe zero-downtime reload at present requires all traffic, sidekiq jobs, etc, to be drained from a node before updating the code on it. It would be nice to be able to remove that requirement - it would greatly simplify deployment to large numbers of hosts.
Original description:
https://sentry.gitlab.net/gitlab/gitlabcom/issues/598291/
NoMethodError: undefined method `enabled?' for Gitlab::Graphql:Module
/opt/gitlab/embedded/service/gitlab-rails/app/views/shared/issuable/_form.html.haml:20:in `_app_views_shared_issuable__form_html_haml___3164432203176180757_70184186498040'
- if Gitlab::Graphql.enabled?
action_view/template.rb:159:in `block in render'
view.send(method_name, locals, buffer, &block)
active_support/notifications.rb:166:in `instrument'
yield payload if block_given?
action_view/template.rb:354:in `instrument'
ActiveSupport::Notifications.instrument("!render_template.action_view".freeze, payload, &block)
action_view/template.rb:157:in `render'
instrument("!render_template".freeze) do
...
(194 additional frame(s) were not displayed)
ActionView::Template::Error: undefined method `enabled?' for Gitlab::Graphql:Module
ActionView::Template::Error: undefined method `enabled?' for Gitlab::Graphql:Module