Avoid raise/handle deadlocks

Can cause log flooding in some edge cases and isn't really needed any
longer. Use a proper conditional followed by an actual error handler.
This commit is contained in:
Joshua Boniface 2022-10-03 14:04:12 -04:00
parent 096bcdfd75
commit 5942aa50fc
1 changed files with 19 additions and 11 deletions

View File

@ -661,15 +661,19 @@ def node_keepalive(logger, config, zkhandler, this_node):
zkhandler.read("base.config.migration_target_selector") zkhandler.read("base.config.migration_target_selector")
!= config["migration_target_selector"] != config["migration_target_selector"]
): ):
raise zkhandler.write(
[
(
"base.config.migration_target_selector",
config["migration_target_selector"],
)
]
)
except Exception: except Exception:
zkhandler.write( logger.out(
[ "Failed to set migration target selector in Zookeeper",
( state="e",
"base.config.migration_target_selector", prefix="main-thread",
config["migration_target_selector"],
)
]
) )
# Set the upstream IP in Zookeeper for clients to read # Set the upstream IP in Zookeeper for clients to read
@ -680,10 +684,14 @@ def node_keepalive(logger, config, zkhandler, this_node):
zkhandler.read("base.config.upstream_ip") zkhandler.read("base.config.upstream_ip")
!= config["upstream_floating_ip"] != config["upstream_floating_ip"]
): ):
raise zkhandler.write(
[("base.config.upstream_ip", config["upstream_floating_ip"])]
)
except Exception: except Exception:
zkhandler.write( logger.out(
[("base.config.upstream_ip", config["upstream_floating_ip"])] "Failed to set upstream floating IP in Zookeeper",
state="e",
prefix="main-thread",
) )
# Get past state and update if needed # Get past state and update if needed