1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

M #-: fix bug in OneFlow service watchdog (#352)

(cherry picked from commit 5e07e0921bac2ed4c27a1f29efb9596b310ccab6)
This commit is contained in:
Alejandro Huertas Herrero 2020-10-23 10:26:38 +02:00 committed by Ruben S. Montero
parent 0a0a24aa80
commit 495ee3d2fb
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
2 changed files with 18 additions and 10 deletions

View File

@ -241,7 +241,7 @@ class ServiceLCM
service.set_state(Service::STATE['RUNNING'])
service.update
@wd.add_service(service_id)
@wd.add_service(service)
end
# If there is no node in PENDING the service is not modified.
@ -484,8 +484,6 @@ class ServiceLCM
if service.all_roles_running?
service.set_state(Service::STATE['RUNNING'])
@wd.add_service(service_id)
elsif service.strategy == 'straight'
set_deploy_strategy(service)
@ -497,7 +495,11 @@ class ServiceLCM
service.report_ready?)
end
service.update
rc = service.update
return rc if OpenNebula.is_error?(rc)
@wd.add_service(service) if service.all_roles_running?
end
Log.error LOG_COMP, rc.message if OpenNebula.is_error?(rc)
@ -656,9 +658,9 @@ class ServiceLCM
service.set_state(Service::STATE['RUNNING'])
service.roles[role_name].set_state(Role::STATE['RUNNING'])
@wd.add_service(service_id)
service.update
@wd.add_service(service)
end
Log.error LOG_COMP, rc.message if OpenNebula.is_error?(rc)

View File

@ -133,10 +133,16 @@ class ServiceWD
# Add service to watch dog
#
# @param service_id [String] Service ID
def add_service(service_id)
# @param service [Service] Service information
def add_service(service)
@mutex.synchronize do
@services << service_id.to_i
@services << Integer(service.id)
end
service.roles.each do |name, role|
role.nodes_ids.each do |node|
check_role_state(client, service.id, name, node)
end
end
end
@ -196,7 +202,7 @@ class ServiceWD
end
@mutex.synchronize do
@services << service.id.to_i
@services << Integer(service.id)
end
service.roles.each do |name, role|