Class: Bosh::Agent::Message::Stop

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh_agent/handler.rb

Overview

FIXME: temporary stop method

Class Method Summary collapse

Class Method Details

.long_running?Boolean

Returns:

  • (Boolean)


440
441
442
# File 'lib/bosh_agent/handler.rb', line 440

def self.long_running?
  true
end

.process(args) ⇒ Object



444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/bosh_agent/handler.rb', line 444

def self.process(args)

  if Config.configure
    Bosh::Agent::Monit.stop_services
  end

  'stopped'

rescue => e
  # Monit retry logic should make it really hard to get here but if it happens we should yell.
  # One potential problem is that drain process might have unmonitored and killed processes
  # already but Monit became really unresponsive. In that case it might be a fake alert:
  # however this is not common and can be handled on case-by-case basis.
  raise Bosh::Agent::MessageHandlerError, "Cannot stop job: #{e}"
end