Turning off port read event state after main process fork.

Master port stores two file descriptors and works as a read port on the master
process side.  After a fork, the port switches into write mode and the read
socket closes, but the same event structure is used for the write socket.
However, the inherited structure remained in read state, telling the epoll
engine to use MOD operation instead of ADD.  The patch resets read event
state, so the engine may write using proper ADD operation.
This commit is contained in:
Max Romanov 2019-03-25 14:49:28 +03:00
parent 6c694d4b47
commit b96e5fd848
2 changed files with 1 additions and 2 deletions

View file

@ -566,6 +566,7 @@ void
nxt_port_read_close(nxt_port_t *port)
{
port->socket.read_ready = 0;
port->socket.read = NXT_EVENT_INACTIVE;
nxt_socket_close(port->socket.task, port->pair[0]);
port->pair[0] = -1;
}

View file

@ -216,9 +216,7 @@ class TestUnitConfiguration(unit.TestUnitControl):
}
}), 'no port')
@unittest.expectedFailure
def test_json_application_name_large(self):
self.skip_alerts.append(r'epoll_ctl.+failed')
name = "X" * 1024 * 1024
self.assertIn('success', self.conf({