diff --git a/thrift/lib/go/thrift/header_simple_server.go b/thrift/lib/go/thrift/header_simple_server.go index 98e2058380a..a78c42afe2e 100644 --- a/thrift/lib/go/thrift/header_simple_server.go +++ b/thrift/lib/go/thrift/header_simple_server.go @@ -79,8 +79,8 @@ func (s *headerSimpleServer) acceptLoop(ctx context.Context) error { } go func(ctx context.Context, conn net.Conn) { - ctx = s.connContext(ctx, conn) - if err := s.processRequests(ctx, conn); err != nil { + ctxConn := s.connContext(ctx, conn) + if err := s.processRequests(ctxConn, conn); err != nil { s.log("error processing request from %s: %s\n", conn.RemoteAddr(), err) cerror := conn.Close() if cerror != nil { diff --git a/thrift/lib/go/thrift/rocket_server_transport.go b/thrift/lib/go/thrift/rocket_server_transport.go index 9280a5e3c2f..cebfe5a7b31 100644 --- a/thrift/lib/go/thrift/rocket_server_transport.go +++ b/thrift/lib/go/thrift/rocket_server_transport.go @@ -108,8 +108,8 @@ func (r *rocketServerTransport) acceptLoop(ctx context.Context) error { } } - ctx = r.connContext(ctx, conn) - r.processRequests(ctx, conn) + ctxConn := r.connContext(ctx, conn) + r.processRequests(ctxConn, conn) }(ctx, conn) } } diff --git a/thrift/lib/go/thrift/rocket_simple_server_transport.go b/thrift/lib/go/thrift/rocket_simple_server_transport.go index eac5c17fd1d..970ab844928 100644 --- a/thrift/lib/go/thrift/rocket_simple_server_transport.go +++ b/thrift/lib/go/thrift/rocket_simple_server_transport.go @@ -105,8 +105,8 @@ func (r *rocketSimpleServerTransport) acceptLoop(ctx context.Context) error { } } - ctx = r.connContext(ctx, conn) - r.processRequests(ctx, conn) + ctxConn := r.connContext(ctx, conn) + r.processRequests(ctxConn, conn) }(ctx, conn) } }