slachiewicz opened a new pull request, #3977: URL: https://github.com/apache/thrift/pull/3977
`TServerSocket::acceptImpl()` threw `UNKNOWN` on any `accept()` failure, and `TServerFramework::serve()` then stops accepting for good. The reproducible case is `EMFILE`: once the process runs out of descriptors, the server stays down after they free up. Now: - out of descriptors or memory (`EMFILE`, `ENFILE`, `ENOBUFS`, `ENOMEM`): back off from 5 ms to 1 s and retry, still interruptible; logged at most once a minute; - errors that belong to the one connection (`ECONNABORTED`, `EPROTO`, and on Linux `EPERM` and the network errors accept(2) says to treat like `EAGAIN`): back to `poll()`, not logged; - anything else: throws as before. The backoff matters on Linux, which keeps the connection queued after `EMFILE`, so the listening socket stays readable; macOS drops it. The tests send a byte after connecting because `listen()` sets `TCP_DEFER_ACCEPT`. Replaces #2964, which retried every error without waiting. The poll loop is only re-indented; `git diff -w` shows the change. `TNonblockingServer` uses `TNonblockingServerSocket` and is not changed. Verified: `UnitTests --run_test=TServerSocketTest` → 3 failures on master, pass with the change, on macOS arm64 and Ubuntu 24.04 arm64. Windows not built. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
