Skip to content

Commit

Permalink
ovn-controller: Fix busy loop when ofctrl is disconnected.
Browse files Browse the repository at this point in the history
ovn-controller runs at 100% cpu when OVS exits. This is because the
ofctrl_run is not called while ofctrl_wait is always called in the main
loop. Because of the missing ofctrl_run, it doesn't even detect that the
ofctrl connection is disconnected.

This patch fixes the issue by always giving a chance to run ofctrl_run
as long as ofctrl_wait is called.

Fixes: 1d6d953 ("controller: Don't artificially limit group and meter IDs to 16bit.")
Fixes: 94cbc59 ("ovn-controller: Fix use of dangling pointers in I-P runtime_data.")
Signed-off-by: Han Zhou <[email protected]>
  • Loading branch information
hzhou8 committed Mar 20, 2024
1 parent 0a35824 commit 6f6db3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion controller/ofctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ ofctrl_run(const struct ovsrec_bridge *br_int,

rconn_run(swconn);

if (!rconn_is_connected(swconn)) {
if (!rconn_is_connected(swconn) || !pending_ct_zones) {
return reconnected;
}

Expand Down
9 changes: 5 additions & 4 deletions controller/ovn-controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -5736,10 +5736,11 @@ main(int argc, char *argv[])
}
}

if (br_int && ovs_feature_set_discovered()) {
if (br_int) {
ct_zones_data = engine_get_data(&en_ct_zones);
if (ct_zones_data && ofctrl_run(br_int, ovs_table,
&ct_zones_data->pending)) {
if (ofctrl_run(br_int, ovs_table,
ct_zones_data ? &ct_zones_data->pending
: NULL)) {
static struct vlog_rate_limit rl
= VLOG_RATE_LIMIT_INIT(1, 1);

Expand All @@ -5748,7 +5749,7 @@ main(int argc, char *argv[])
engine_set_force_recompute(true);
}

if (chassis) {
if (chassis && ovs_feature_set_discovered()) {
encaps_run(ovs_idl_txn, br_int,
sbrec_chassis_table_get(ovnsb_idl_loop.idl),
chassis,
Expand Down

0 comments on commit 6f6db3a

Please sign in to comment.