Rescue SOAP error while retrieving stats
@@ -1154,12 +1154,17 @@ class Djinn
@nodes.each { |node|
ip = node.private_ip
if ip == my_node.private_ip
+ begin
node_stats = JSON.load(get_node_stats_json(@@secret))
+ rescue SOAP::FaultError
+ Djinn.log_warn("Failed to get local status update.")
+ next
+ end
else
acc = AppControllerClient.new(ip, @@secret)
begin
node_stats = JSON.load(acc.get_node_stats_json)
- rescue FailedNodeException
+ rescue FailedNodeException, SOAP::FaultError
Djinn.log_warn("Failed to get status update from node at #{ip}, so " \
"not adding it to our cached info.")
next
@@ -1926,12 +1931,16 @@ class Djinn
if my_node.is_shadow? && @options['autoscale'].downcase != "true"
Djinn.log_info("--- This deployment has autoscale disabled.")
end
+ begin
stats = JSON.parse(get_node_stats_json(secret))
Djinn.log_info("--- Node at #{stats['public_ip']} has " \
"#{stats['memory']['available']/MEGABYTE_DIVISOR}MB memory available " \
"and knows about these apps #{stats['apps']}.")
Djinn.log_debug("--- Node stats: #{JSON.pretty_generate(stats)}")
last_print = Time.now.to_i
+ rescue SOAP::FaultError
+ Djinn.log_warn("Failed to get local node stats: skipping stats")
+ end
end
# Let's make sure we don't drift the duty cycle too much.
