diff --git a/app/models/clusters/applications/prometheus.rb b/app/models/clusters/applications/prometheus.rb index 5716614b8ac..d24a298b0a6 100644 --- a/app/models/clusters/applications/prometheus.rb +++ b/app/models/clusters/applications/prometheus.rb @@ -90,7 +90,7 @@ module Clusters # ensures headers containing auth data are appended to original k8s client options options = kube_client.rest_client.options.merge(headers: kube_client.headers) Gitlab::PrometheusClient.new(proxy_url, options) - rescue Kubeclient::HttpError, Errno::ECONNRESET, Errno::ECONNREFUSED + rescue Kubeclient::HttpError, Errno::ECONNRESET, Errno::ECONNREFUSED, Errno::ENETUNREACH # If users have mistakenly set parameters or removed the depended clusters, # `proxy_url` could raise an exception because gitlab can not communicate with the cluster. # Since `PrometheusAdapter#can_query?` is eargely loaded on environement pages in gitlab, diff --git a/app/models/note.rb b/app/models/note.rb index cfa7ba98081..7731b477ad0 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -152,9 +152,7 @@ class Note < ApplicationRecord scope :for_note_or_capitalized_note, ->(text) { where(note: [text, text.capitalize]) } scope :like_note_or_capitalized_note, ->(text) { where('(note LIKE ? OR note LIKE ?)', text, text.capitalize) } - after_initialize :ensure_discussion_id before_validation :nullify_blank_type, :nullify_blank_line_code - before_validation :set_discussion_id, on: :create after_save :keep_around_commit, if: :for_project_noteable?, unless: :importing? after_save :expire_etag_cache, unless: :importing? after_save :touch_noteable, unless: :importing? @@ -394,7 +392,7 @@ class Note < ApplicationRecord # See `Discussion.override_discussion_id` for details. def discussion_id(noteable = nil) - discussion_class(noteable).override_discussion_id(self) || super() + discussion_class(noteable).override_discussion_id(self) || super() || ensure_discussion_id end # Returns a discussion containing just this note. @@ -533,17 +531,13 @@ class Note < ApplicationRecord end def ensure_discussion_id - return unless self.persisted? - # Needed in case the SELECT statement doesn't ask for `discussion_id` - return unless self.has_attribute?(:discussion_id) - return if self.discussion_id + return if self.attribute_present?(:discussion_id) - set_discussion_id - update_column(:discussion_id, self.discussion_id) + self.discussion_id = derive_discussion_id end - def set_discussion_id - self.discussion_id ||= discussion_class.discussion_id(self) + def derive_discussion_id + discussion_class.discussion_id(self) end def all_referenced_mentionables_allowed?(user) diff --git a/changelogs/unreleased/fix-prometheus-network-connectivity-error.yml b/changelogs/unreleased/fix-prometheus-network-connectivity-error.yml new file mode 100644 index 00000000000..c0de02aa990 --- /dev/null +++ b/changelogs/unreleased/fix-prometheus-network-connectivity-error.yml @@ -0,0 +1,5 @@ +--- +title: Return 503 error when metrics dashboard has no connectivity +merge_request: 22140 +author: +type: fixed diff --git a/changelogs/unreleased/issue_2030_2.yml b/changelogs/unreleased/issue_2030_2.yml new file mode 100644 index 00000000000..317a2850fff --- /dev/null +++ b/changelogs/unreleased/issue_2030_2.yml @@ -0,0 +1,5 @@ +--- +title: Process quick actions when using Service Desk templates +merge_request: 21948 +author: +type: fixed diff --git a/changelogs/unreleased/remove-note-after-initialize.yml b/changelogs/unreleased/remove-note-after-initialize.yml new file mode 100644 index 00000000000..0fff2669fec --- /dev/null +++ b/changelogs/unreleased/remove-note-after-initialize.yml @@ -0,0 +1,5 @@ +--- +title: Remove after_initialize and before_validation for Note +merge_request: 22128 +author: +type: performance diff --git a/doc/administration/high_availability/README.md b/doc/administration/high_availability/README.md index d411fb7f20f..13b6bd88453 100644 --- a/doc/administration/high_availability/README.md +++ b/doc/administration/high_availability/README.md @@ -224,14 +224,9 @@ users are, how much automation you use, mirroring, and repo/change size. - **Supported Users (approximate):** 2,000 - **Test RPS Rates:** API: 40 RPS, Web: 4 RPS, Git: 4 RPS -- **Status:** Work-in-progress - **Known Issues:** For the latest list of known performance issues head [here](https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=Quality%3Aperformance-issues). -NOTE: **Note:** This architecture is a work-in-progress of the work so far. The -Quality team will be certifying this environment in late 2019 or early 2020. The specifications -may be adjusted prior to certification based on performance testing. - | Service | Nodes | Configuration | GCP type | | ----------------------------|-------|-----------------------|---------------| | GitLab Rails
- Puma workers on each node set to 90% of available CPUs with 8 threads | 3 | 8 vCPU, 7.2GB Memory | n1-highcpu-8 | @@ -255,14 +250,9 @@ vendors a best effort like for like can be used. - **Supported Users (approximate):** 5,000 - **Test RPS Rates:** API: 100 RPS, Web: 10 RPS, Git: 10 RPS -- **Status:** Work-in-progress - **Known Issues:** For the latest list of known performance issues head [here](https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=Quality%3Aperformance-issues). -NOTE: **Note:** This architecture is a work-in-progress of the work so far. The -Quality team will be certifying this environment in late 2019 or early 2020. The specifications -may be adjusted prior to certification based on performance testing. - | Service | Nodes | Configuration | GCP type | | ----------------------------|-------|-----------------------|---------------| | GitLab Rails
- Puma workers on each node set to 90% of available CPUs with 16 threads | 3 | 16 vCPU, 14.4GB Memory | n1-highcpu-16 | diff --git a/lib/gitlab/email/handler/reply_processing.rb b/lib/gitlab/email/handler/reply_processing.rb index d8f4be8ada1..6b7686cd405 100644 --- a/lib/gitlab/email/handler/reply_processing.rb +++ b/lib/gitlab/email/handler/reply_processing.rb @@ -79,3 +79,5 @@ module Gitlab end end end + +Gitlab::Email::Handler::ReplyProcessing.prepend_if_ee('::EE::Gitlab::Email::Handler::ReplyProcessing') diff --git a/spec/models/clusters/applications/prometheus_spec.rb b/spec/models/clusters/applications/prometheus_spec.rb index e7f5f493b82..cf33d2b4273 100644 --- a/spec/models/clusters/applications/prometheus_spec.rb +++ b/spec/models/clusters/applications/prometheus_spec.rb @@ -117,6 +117,12 @@ describe Clusters::Applications::Prometheus do let(:exception) { Errno::ECONNRESET } end end + + context 'when the network is unreachable' do + it_behaves_like 'exception caught for prometheus client' do + let(:exception) { Errno::ENETUNREACH } + end + end end end