Postpone op callbacks to the end of handle_read(), fix a bug where primary OSD could reply -EPIPE with data to a read operation

This commit is contained in:
Vitaliy Filippov
2020-06-16 01:36:38 +03:00
parent 27ee14a4e6
commit 0f6d193d73
4 changed files with 50 additions and 16 deletions
+3 -2
View File
@@ -179,6 +179,7 @@ struct osd_messenger_t
std::map<int, osd_client_t> clients;
std::vector<int> read_ready_clients;
std::vector<int> write_ready_clients;
std::vector<std::function<void()>> set_immediate;
// op statistics
osd_op_stats_t stats;
@@ -207,7 +208,7 @@ protected:
void handle_send(int result, int peer_fd);
bool handle_read(int result, int peer_fd);
void handle_finished_read(osd_client_t & cl);
bool handle_finished_read(osd_client_t & cl);
void handle_op_hdr(osd_client_t *cl);
void handle_reply_hdr(osd_client_t *cl);
bool handle_reply_hdr(osd_client_t *cl);
};