Skip to content

Commit

Permalink
issue: 1491767 Increase SO_RCVTIMEO for agent socket
Browse files Browse the repository at this point in the history
During stressful scenario when mass of sockets are opened/closed
daemon processes income messages slower. Increasing wait timeout
during recieve of daemon`s answer allows to issues during
communication agent/daemon.
Another way: to avoid using blocking operations on agent side.

Signed-off-by: Igor Ivanov <[email protected]>
  • Loading branch information
igor-ivanov authored and liranoz12 committed Aug 15, 2018
1 parent 0f02b42 commit 607a8ff
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/vma/util/agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,10 @@ int agent::create_agent_socket(void)
goto err;
}

/* Sets the timeout value as 1 sec that specifies the maximum amount of time
/* Sets the timeout value as 3 sec that specifies the maximum amount of time
* an input function waits until it completes.
*/
opttv.tv_sec = 1;
opttv.tv_sec = 3;
opttv.tv_usec = 0;
sys_call(rc, setsockopt, m_sock_fd, SOL_SOCKET, SO_RCVTIMEO,
(const void *)&opttv, sizeof(opttv));
Expand Down
28 changes: 14 additions & 14 deletions tools/daemon/notify.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,19 @@ static int clean_process(pid_t pid)
struct list_head *tmp_entry = NULL;
int i, j;

/* Cleanup flow store */
j = 0;
list_for_each_safe(cur_entry, tmp_entry, &pid_value->flow_list) {
flow_value = list_entry(cur_entry, struct store_flow, item);
j++;
log_debug("[%d] #%d found handle: 0x%08X type: %d if_id: %d tap_id: %d\n",
pid_value->pid, j,
flow_value->handle, flow_value->type, flow_value->if_id, flow_value->tap_id);
list_del_init(&flow_value->item);
del_flow(pid_value, flow_value);
free(flow_value);
}

/* Cleanup fid store */
j = 0;
for (i = 0; (i < hash_size(pid_value->ht)) &&
Expand Down Expand Up @@ -334,19 +347,6 @@ static int clean_process(pid_t pid)
}
}

/* Cleanup flow store */
j = 0;
list_for_each_safe(cur_entry, tmp_entry, &pid_value->flow_list) {
flow_value = list_entry(cur_entry, struct store_flow, item);
j++;
log_debug("[%d] #%d found handle: 0x%08X type: %d if_id: %d tap_id: %d\n",
pid_value->pid, j,
flow_value->handle, flow_value->type, flow_value->if_id, flow_value->tap_id);
list_del_init(&flow_value->item);
del_flow(pid_value, flow_value);
free(flow_value);
}

hash_del(daemon_cfg.ht, pid);
log_debug("[%d] remove from the storage\n", pid);

Expand All @@ -368,7 +368,7 @@ static int check_process(pid_t pid)

rc = snprintf(process_file, sizeof(process_file), "/proc/%d/stat", pid);
if ((0 < rc) && (rc < (int)sizeof(process_file))) {
FILE* fd = fopen(process_file, "r");;
FILE* fd = fopen(process_file, "r");
if (fd) {
int pid_v = 0;
char name_v[32];
Expand Down

0 comments on commit 607a8ff

Please sign in to comment.