Router: fixing assertion in shortage of file descriptors.
Each application in router process required fd for a request queue shared memory. When the number of file descripts close to the limit, and port sockets successfully opened, router needs to properly handle the errors. This patch closes port sockets before destroying port structure to avoid file descriptors leakage and assertion in debug build.
This commit is contained in:
@@ -1586,6 +1586,8 @@ nxt_router_conf_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf,
|
|||||||
|
|
||||||
ret = nxt_router_app_queue_init(task, port);
|
ret = nxt_router_app_queue_init(task, port);
|
||||||
if (nxt_slow_path(ret != NXT_OK)) {
|
if (nxt_slow_path(ret != NXT_OK)) {
|
||||||
|
nxt_port_write_close(port);
|
||||||
|
nxt_port_read_close(port);
|
||||||
nxt_port_use(task, port, -1);
|
nxt_port_use(task, port, -1);
|
||||||
return NXT_ERROR;
|
return NXT_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user