diff --git a/src/server/master.cc b/src/server/master.cc index 9290aa08b21..56564ba6b43 100644 --- a/src/server/master.cc +++ b/src/server/master.cc @@ -925,7 +925,9 @@ void Server::stop_master_thread() { if (port->is_dgram() and is_process_mode()) { continue; } - reactor->del(port->socket); + if (!port->socket->removed) { + reactor->del(port->socket); + } } if (pipe_command) { reactor->del(pipe_command->get_socket(true)); diff --git a/src/server/reactor_thread.cc b/src/server/reactor_thread.cc index 97a62a8d191..9f83cc55d18 100644 --- a/src/server/reactor_thread.cc +++ b/src/server/reactor_thread.cc @@ -310,7 +310,9 @@ void ReactorThread::shutdown(Reactor *reactor) { if (ls->socket->fd % serv->reactor_num != reactor->id) { continue; } - reactor->del(ls->socket); + if (!ls->socket->removed) { + reactor->del(ls->socket); + } } } } diff --git a/tests/swoole_server/task/finish_timeout.phpt b/tests/swoole_server/task/finish_timeout.phpt index 491e3b2e2b8..bc4ab48e951 100644 --- a/tests/swoole_server/task/finish_timeout.phpt +++ b/tests/swoole_server/task/finish_timeout.phpt @@ -65,4 +65,4 @@ unlink(TMP_LOG_FILE); ?> --EXPECTF-- [%s] WARNING Socket::send_blocking(): send %d bytes failed, Error: Resource temporarily unavailable[11] -[%s] WARNING Server::reply_task_result() (ERRNO %d): send result to worker timed out +[%s] WARNING Server::finish() (ERRNO %d): send result to worker timed out