| 180 | } |
| 181 | |
| 182 | void Server::Execute(std::shared_ptr<const Operation> operation) |
| 183 | { |
| 184 | PID client_pid = operation->Pid(); |
| 185 | |
| 186 | chan_mtx_.lock(); |
| 187 | auto it = client_chans_.find(client_pid); |
| 188 | |
| 189 | if (it == client_chans_.end()) { |
| 190 | chan_mtx_.unlock(); |
| 191 | // It is possible that the server has received ProcessDestroyEvent in RecvWorker(), |
| 192 | // and the channel has been closed before the scheduler processes the event. |
| 193 | XDEBG("cannot find client channel for client process " FMT_PID, client_pid); |
| 194 | return; |
| 195 | } |
| 196 | |
| 197 | std::shared_ptr<ipc::Node> client_chan = it->second; |
| 198 | chan_mtx_.unlock(); |
| 199 | |
| 200 | XASSERT(client_chan->Send(operation->Data(), operation->Size()), |
| 201 | "cannot send operation to client process " FMT_PID, client_pid); |
| 202 | } |
| 203 | |
| 204 | XQueueHandle Server::GetXQueueHandle(const Json::Value &request) |
| 205 | { |