Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mgmtd: don't try to send config to disconnected clients #15134

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions mgmtd/mgmt_txn.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,10 +850,9 @@ static int mgmt_txn_create_config_batches(struct mgmt_txn_req *txn_req,
enum mgmt_be_client_id id;
struct mgmt_be_client_adapter *adapter;
struct mgmt_commit_cfg_req *cmtcfg_req;
bool found_validator;
int num_chgs = 0;
int xpath_len, value_len;
uint64_t clients;
uint64_t clients, chg_clients;

cmtcfg_req = &txn_req->req.commit_cfg;

Expand Down Expand Up @@ -881,11 +880,8 @@ static int mgmt_txn_create_config_batches(struct mgmt_txn_req *txn_req,
value ? value : "NIL");

clients = mgmt_be_interested_clients(xpath, true);
cmtcfg_req->clients |= clients;
if (clients)
found_validator = true;
else
found_validator = false;

chg_clients = 0;

xpath_len = strlen(xpath) + 1;
value_len = strlen(value) + 1;
Expand All @@ -894,6 +890,8 @@ static int mgmt_txn_create_config_batches(struct mgmt_txn_req *txn_req,
if (!adapter)
continue;

chg_clients |= (1ull << id);

batch = cmtcfg_req->last_be_cfg_batch[id];
if (!batch ||
(batch->num_cfg_data ==
Expand Down Expand Up @@ -940,13 +938,15 @@ static int mgmt_txn_create_config_batches(struct mgmt_txn_req *txn_req,
num_chgs++;
}

if (!found_validator) {
if (!chg_clients) {
snprintf(err_buf, sizeof(err_buf),
"No validator module found for XPATH: '%s",
xpath);
MGMTD_TXN_ERR("***** %s", err_buf);
}

cmtcfg_req->clients |= chg_clients;

free(xpath);
}

Expand Down
Loading