Skip to content

Commit

Permalink
Don't need to monitor workers on k8s/systemd
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Dec 14, 2020
1 parent 91f98a9 commit 49de68a
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions app/models/miq_server/worker_management/monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ def monitor_workers

cleanup_failed_workers

# Monitor all remaining current worker records
miq_workers.where(:status => MiqWorker::STATUSES_CURRENT_OR_STARTING).each do |worker|
# Push the heartbeat into the database
persist_last_heartbeat(worker)
# Check the worker record for heartbeat timeouts
validate_worker(worker)
end
validate_current_workers

do_system_limit_exceeded if self.kill_workers_due_to_resources_exhausted?
end
Expand Down Expand Up @@ -84,6 +78,22 @@ def cleanup_orphaned_worker_rows
end
end

def validate_current_workers
# When k8s or systemd is operating as the worker monitor then all of the
# worker monitoring (liveness, memory threshold) is handled by those
# systems. Only when workers are run as standalone processes does MiqServer
# have to monitor the workers itself.
return if podified? || systemd?

# Monitor all remaining current worker records
miq_workers.where(:status => MiqWorker::STATUSES_CURRENT_OR_STARTING).each do |worker|
# Push the heartbeat into the database
persist_last_heartbeat(worker)
# Check the worker record for heartbeat timeouts
validate_worker(worker)
end
end

def cleanup_failed_workers
check_not_responding
check_pending_stop
Expand Down

0 comments on commit 49de68a

Please sign in to comment.