After listen_socket was closed, it entered the start() processf magically. so
I think we should make '_fd = -1' when listen_socket was closed. And in the
start process, determine the value of listen_socket, if it equal to -1, return
the process.
Fixes: https://tracker.ceph.com/issues/23600
Signed-off-by: shangfufei <shangfufei@inspur.com>
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
// start thread
worker->center.submit_to(worker->center.get_id(), [this]() {
for (auto& l : listen_sockets) {
- if (l) {
+ if (l) {
+ if (l.fd() == -1) {
+ ldout(msgr->cct, 1) << __func__ << " Erro: processor restart after listen_socket.fd closed. " << this << dendl;
+ return;
+ }
worker->center.create_file_event(l.fd(), EVENT_READABLE,
listen_handler); }
}
int accept(ConnectedSocket *sock, const SocketOptions &opts, entity_addr_t *out, Worker *w) override;
void abort_accept() override {
::close(_fd);
+ _fd = -1;
}
int fd() const override {
return _fd;