web UI added and refactoring done
This commit is contained in:
@@ -511,8 +511,16 @@ void TcpServer::acceptor_loop() {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
continue;
|
||||
}
|
||||
// Listening socket closed during shutdown produces EBADF/EINVAL; bail.
|
||||
break;
|
||||
// Shutdown closes the listening socket (EBADF/EINVAL) -> bail. But an
|
||||
// unexpected errno on a still-running server (e.g. EPERM from a firewall
|
||||
// rule) must NOT kill the acceptor and silently stop serving new clients:
|
||||
// log, back off, and keep accepting.
|
||||
if (!running_.load(std::memory_order_acquire)) {
|
||||
break;
|
||||
}
|
||||
std::cerr << "locator: accept() failed (errno=" << errno << "); retrying\n";
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
continue;
|
||||
}
|
||||
|
||||
reap_finished_clients();
|
||||
|
||||
Reference in New Issue
Block a user