diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-25 21:06:28 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-25 21:06:28 +0000 |
commit | eb7390edf3afd52174b786fff1e06d5ffae0cec5 (patch) | |
tree | 395dce44e5ea2b55704414e4d38fc24da4b1b676 /lib | |
parent | 801ced25ff0540b096c395f9ac8d2d9e005878e8 (diff) | |
download | gitlab-ce-eb7390edf3afd52174b786fff1e06d5ffae0cec5.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/analytics/cycle_analytics/stage_events/stage_event.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/gpg.rb | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/gitlab/analytics/cycle_analytics/stage_events/stage_event.rb b/lib/gitlab/analytics/cycle_analytics/stage_events/stage_event.rb index 667d6def414..0c75a141c3c 100644 --- a/lib/gitlab/analytics/cycle_analytics/stage_events/stage_event.rb +++ b/lib/gitlab/analytics/cycle_analytics/stage_events/stage_event.rb @@ -8,6 +8,8 @@ module Gitlab class StageEvent include Gitlab::CycleAnalytics::MetricsTables + delegate :label_based?, to: :class + def initialize(params) @params = params end @@ -35,7 +37,7 @@ module Gitlab query end - def label_based? + def self.label_based? false end diff --git a/lib/gitlab/gpg.rb b/lib/gitlab/gpg.rb index 1dce26efc65..829e64b11a4 100644 --- a/lib/gitlab/gpg.rb +++ b/lib/gitlab/gpg.rb @@ -5,7 +5,7 @@ module Gitlab extend self CleanupError = Class.new(StandardError) - BG_CLEANUP_RUNTIME_S = 2 + BG_CLEANUP_RUNTIME_S = 10 FG_CLEANUP_RUNTIME_S = 0.5 MUTEX = Mutex.new @@ -107,19 +107,18 @@ module Gitlab begin cleanup_tmp_dir(tmp_dir) rescue CleanupError => e + folder_contents = Dir.children(tmp_dir) # This means we left a GPG-agent process hanging. Logging the problem in # sentry will make this more visible. Gitlab::Sentry.track_exception(e, issue_url: 'https://gitlab.com/gitlab-org/gitlab/issues/20918', - extra: { tmp_dir: tmp_dir }) + extra: { tmp_dir: tmp_dir, contents: folder_contents }) end tmp_keychains_removed.increment unless File.exist?(tmp_dir) end def cleanup_tmp_dir(tmp_dir) - return FileUtils.remove_entry(tmp_dir, true) if Feature.disabled?(:gpg_cleanup_retries) - # Retry when removing the tmp directory failed, as we may run into a # race condition: # The `gpg-agent` agent process may clean up some files as well while |