Skip to content

Commit

Permalink
Merge pull request #111 from fnordahl/bug/2045865
Browse files Browse the repository at this point in the history
snap/hooks/pre-refresh: Add timeout to *-appctl calls.
  • Loading branch information
fnordahl authored Dec 7, 2023
2 parents 10b9bc0 + c5e5a2c commit d818d09
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions snap/hooks/pre-refresh
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#!/bin/sh

# The amout of time to wait in seconds for the case where the app socket
# accepts connections and the daemon for some reason does not service requests.
TIMEOUT=30

# NOTE(fnordahl): tell the ovn-controller to exit without cleaning up flows nor
# SB DB state on refresh.
${SNAP}/commands/ovn-appctl exit --restart || true
${SNAP}/commands/ovn-appctl --timeout ${TIMEOUT} exit --restart || true

# Note (mkalcok): `microovn.switch` service, by default, stops OVS
# vswitch daemon with `--cleanup` flag that releases datapath
# resources like ports and bridges. This hook prevents such behavior
# by stopping the daemon without `--cleanup` flag during the snap
# refresh.

${SNAP}/commands/ovs-appctl exit || true
${SNAP}/commands/ovs-appctl --timeout ${TIMEOUT} exit || true

0 comments on commit d818d09

Please sign in to comment.