Sylwester Lachiewicz created THRIFT-6208:
--------------------------------------------

             Summary: Go: Support server connection limiting and admission 
control middleware
                 Key: THRIFT-6208
                 URL: https://issues.apache.org/jira/browse/THRIFT-6208
             Project: Thrift
          Issue Type: Improvement
          Components: Go - Library
            Reporter: Sylwester Lachiewicz


Currently, TSimpleServer in lib/go/thrift processes incoming connections via an 
unbounded accept loop. During traffic surges or denial-of-service conditions, 
this can exhaust operating system file descriptors (FD exhaustion) or cause 
out-of-memory crashes. In addition, there is no standardized abstraction to 
integrate adaptive load shedding or rate limiting at the RPC request level.

### Proposed Solution
1. L4 Connection Limiting:
   - Add NewTServerSocketFromListener(listener net.Listener, clientTimeout 
time.Duration) in lib/go/thrift/server_socket.go. This enables direct 
integration with standard Go listener decorators such as 
golang.org/x/net/netutil.LimitListener to bound concurrent open sockets.
2. L7 Request-Level Admission Control:
   - Introduce an AdmissionController interface and NewAdmissionMiddleware 
helper for WrapProcessor in lib/go/thrift.
   - Enables users to plug in external adaptive concurrency limiters (e.g. 
Netflix Concurrency Limits / Vegas / Gradient algorithms, failsafe-go, 
sentinel-golang) to shed load and reject requests with TApplicationException 
before invoking expensive user service handlers.



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

Reply via email to