mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-21 04:12:37 +09:00
Feature #1852: Service is not stuck in 'scaling' if a failure occurs
This commit is contained in:
1 parent
78593f7fb8
commit
d367ea88fb
2 files changed
+15
-1
No files matched your search
@@ -90,7 +90,11 @@ class ServiceLCM
|
||||
# TODO: Check scalability rules for roles that are
|
||||
# not scaling now?
|
||||
|
||||
if service.all_roles_running?
|
||||
# The service is moved to RUNNING even if the
|
||||
# roles scaling ended in failure. Any error is
|
||||
# handled the next cycle in the RUNNING case
|
||||
|
||||
if !service.any_role_scaling?
|
||||
service.set_state(Service::STATE['RUNNING'])
|
||||
end
|
||||
when Service::STATE['UNKNOWN']
|
||||
|
||||
@@ -144,6 +144,16 @@ module OpenNebula
|
||||
return false
|
||||
end
|
||||
|
||||
def any_role_scaling?()
|
||||
@roles.each do |name, role|
|
||||
if role.state == Role::STATE['SCALING']
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
# Create a new service based on the template provided
|
||||
# @param [String] template_json
|
||||
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
||||
|
||||
Reference in new issue
Block a user