Skip to content

Commit

Permalink
dw_node.c: fix regression bug after commit 51e76d6, restoring ability…
Browse files Browse the repository at this point in the history
… to reply to the first connection, and removing 100% CPU on epoll due to the descriptor not being read()/recv().
  • Loading branch information
tomcucinotta committed Sep 18, 2023
1 parent cca37fd commit d0e7774
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/dw_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,10 +1103,10 @@ void* conn_worker(void* args) {
// Use the data.u32 field to store the conn_id in conns[]
ev.data.u32 = conn_id;

if (epoll_ctl(epollfd, EPOLL_CTL_ADD, conn_sock, &ev) < 0)
if (epoll_ctl(epollfd, EPOLL_CTL_ADD, conn_sock, &ev) < 0)
perror("epoll_ctl() failed");
}
else if (events[i].data.fd == infos->store_replyfd) {
else if (storage_path && events[i].data.fd == infos->store_replyfd) {
// storage operation completed
// TODO: code
}
Expand Down Expand Up @@ -1269,6 +1269,11 @@ int main(int argc, char *argv[]) {
}

storage_info.nthread = nthread;
} else {
for (int i = 0; i < nthread; i++) {
thread_infos[i].storefd = -1;
thread_infos[i].store_replyfd = -1;
}
}

/*---- Configure settings of the server address struct ----*/
Expand Down

0 comments on commit d0e7774

Please sign in to comment.