Jens Geyer created THRIFT-6359:
----------------------------------

             Summary: Rust TServer stops listening when an accepted connection 
cannot be set up
                 Key: THRIFT-6359
                 URL: https://issues.apache.org/jira/browse/THRIFT-6359
             Project: Thrift
          Issue Type: Bug
          Components: Rust - Library
            Reporter: Jens Geyer


{{TServer::listen}} passes each accepted connection to {{handle_stream}} with 
{{?}}, so an error while setting up one connection ends the listen loop and 
{{listen}} returns. {{TTcpChannel::split()}} fails when the stream cannot be 
duplicated, for example while the process has no file descriptors left. 
{{listen_uds}} has the same loop, and there {{split()}} calls 
{{try_clone().unwrap()}} and panics instead. {{listen_tls}} uses the same 
pattern, but the {{split()}} of its channel cannot fail. An error from 
{{accept}} itself is only logged.

Proposed change: log such a connection, drop it and go on accepting, as after a 
failed accept, and return the {{try_clone()}} error from the Unix domain 
socket's {{split()}}. {{listen_tls}} gets the same handling, so the three loops 
stay alike.

Not part of this change: while no descriptors are left, {{accept}} keeps 
failing and the loop retries at once. A short back-off there would be a 
separate change.

Reported by Sylwester Lachiewicz.

_Drafted with AI assistance (Claude Opus 5 and Claude Opus 5.5); reviewed and 
posted by Jens Geyer._




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to