eBay / NuRaft

C++ implementation of Raft core logic as a replication library
Apache License 2.0
993 stars 235 forks source link

auto_fwd_resp_handler should forward resp->get_result_code (#497) #498

Closed byronhe closed 4 months ago

byronhe commented 4 months ago

Thanks @byronhe for addressing this issue.

In addition to your fix, there is one more bug here: code should be set to FAILED when err exists:

    if (err) {
        perr = err;
        code = cmd_result_code::FAILED;
    } else {
        if (resp->get_accepted()) {
            resp_ctx = resp->get_ctx();
            presult->accept();
        }
        code = resp->get_result_code();
    }

Also code should be set regardless of resp->get_accepted().

If you don't mind, can you please fix this as well?

Thank you for your suggestion. I made fix according to your advice. Could you please review it again?