Skip to content

Commit

Permalink
Avoid raise/handle deadlocks
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
joshuaboniface committed Oct 3, 2022
1 parent 096bcdf commit 5942aa5
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions node-daemon/pvcnoded/util/keepalive.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,15 +661,19 @@ def node_keepalive(logger, config, zkhandler, this_node):
zkhandler.read("base.config.migration_target_selector")
!= config["migration_target_selector"]
):
raise
zkhandler.write(
[
(
"base.config.migration_target_selector",
config["migration_target_selector"],
)
]
)
except Exception:
zkhandler.write(
[
(
"base.config.migration_target_selector",
config["migration_target_selector"],
)
]
logger.out(
"Failed to set migration target selector in Zookeeper",
state="e",
prefix="main-thread",
)

# Set the upstream IP in Zookeeper for clients to read
Expand All @@ -680,10 +684,14 @@ def node_keepalive(logger, config, zkhandler, this_node):
zkhandler.read("base.config.upstream_ip")
!= config["upstream_floating_ip"]
):
raise
zkhandler.write(
[("base.config.upstream_ip", config["upstream_floating_ip"])]
)
except Exception:
zkhandler.write(
[("base.config.upstream_ip", config["upstream_floating_ip"])]
logger.out(
"Failed to set upstream floating IP in Zookeeper",
state="e",
prefix="main-thread",
)

# Get past state and update if needed
Expand Down

0 comments on commit 5942aa5

Please sign in to comment.