Class: Gitlab::HealthChecks::MasterCheck

Inherits:
Object
  • Object
show all
Extended by:
SimpleAbstractCheck
Defined in:
lib/gitlab/health_checks/master_check.rb

Overview

This check is registered on master, and validated by worker

Class Method Summary collapse

Methods included from SimpleAbstractCheck

metrics, readiness

Methods included from BaseAbstractCheck

#human_name, #metrics, #name, #readiness

Class Method Details

.finish_masterObject


18
19
20
21
# File 'lib/gitlab/health_checks/master_check.rb', line 18

def finish_master
  close_read
  close_write
end

.register_masterObject


11
12
13
14
15
16
# File 'lib/gitlab/health_checks/master_check.rb', line 11

def register_master
  # when we fork, we pass the read pipe to child
  # child can then react on whether the other end
  # of pipe is still available
  @pipe_read, @pipe_write = IO.pipe
end

.register_workerObject


23
24
25
26
# File 'lib/gitlab/health_checks/master_check.rb', line 23

def register_worker
  # fork needs to close the pipe
  close_write
end