diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-08-19 08:15:24 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-19 08:15:24 -0400 |
| commit | b80a2cd3942a65f37b66dbf5fe7a1105a50e6bbc (patch) | |
| tree | 5196a8dd0e468198a616f5c93d0ea080ac97ab38 /lib/northbound_grpc.cpp | |
| parent | 4fe5bc8c6282b58cbd9206146bb38e983f815de8 (diff) | |
| parent | 0fe5b904b76ee37ee0d6ad6230e1ea330694f2ea (diff) | |
Merge pull request #6920 from opensourcerouting/nb-errors-apply-phase
lib: don't ignore error messages generated during the commit apply phase
Diffstat (limited to 'lib/northbound_grpc.cpp')
| -rw-r--r-- | lib/northbound_grpc.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/northbound_grpc.cpp b/lib/northbound_grpc.cpp index 83d7e0ce95..f49a3b23f6 100644 --- a/lib/northbound_grpc.cpp +++ b/lib/northbound_grpc.cpp @@ -690,12 +690,14 @@ class NorthboundImpl break; case frr::CommitRequest::ABORT: nb_candidate_commit_abort( - candidate->transaction); + candidate->transaction, errmsg, + sizeof(errmsg)); break; case frr::CommitRequest::APPLY: nb_candidate_commit_apply( candidate->transaction, true, - &transaction_id); + &transaction_id, errmsg, + sizeof(errmsg)); break; case frr::CommitRequest::ALL: ret = nb_candidate_commit( @@ -741,6 +743,8 @@ class NorthboundImpl tag->response.set_transaction_id( transaction_id); } + if (strlen(errmsg) > 0) + tag->response.set_error_message(errmsg); tag->responder.Finish(tag->response, status, tag); tag->state = FINISH; @@ -1281,10 +1285,13 @@ class NorthboundImpl void delete_candidate(struct candidate *candidate) { + char errmsg[BUFSIZ] = {0}; + _candidates.erase(candidate->id); nb_config_free(candidate->config); if (candidate->transaction) - nb_candidate_commit_abort(candidate->transaction); + nb_candidate_commit_abort(candidate->transaction, + errmsg, sizeof(errmsg)); } struct candidate *get_candidate(uint32_t candidate_id) |
