From 6bc48d0e25668a6cd6810178e68adab6fca58dae Mon Sep 17 00:00:00 2001 From: Adam Niedzielski Date: Sat, 13 May 2017 18:00:49 +0300 Subject: [PATCH] Allow GitLab instance to start when InfluxDB hostname cannot be resolved Closes #24438 --- changelogs/unreleased/adam-influxdb-hostname.yml | 4 ++++ lib/gitlab/metrics.rb | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 changelogs/unreleased/adam-influxdb-hostname.yml diff --git a/changelogs/unreleased/adam-influxdb-hostname.yml b/changelogs/unreleased/adam-influxdb-hostname.yml new file mode 100644 index 00000000000..ab201ae7894 --- /dev/null +++ b/changelogs/unreleased/adam-influxdb-hostname.yml @@ -0,0 +1,4 @@ +--- +title: Allow GitLab instance to start when InfluxDB hostname cannot be resolved +merge_request: 11356 +author: diff --git a/lib/gitlab/metrics.rb b/lib/gitlab/metrics.rb index c6dfa4ad9bd..cb8db2f1e9f 100644 --- a/lib/gitlab/metrics.rb +++ b/lib/gitlab/metrics.rb @@ -49,6 +49,9 @@ module Gitlab end end end + rescue Errno::EADDRNOTAVAIL, SocketError => ex + Gitlab::EnvironmentLogger.error('Cannot resolve InfluxDB address. GitLab Performance Monitoring will not work.') + Gitlab::EnvironmentLogger.error(ex) end def self.prepare_metrics(metrics)