Skip to content

Thread leak in transportMonitor / resetAddrConn #1402

@snktagarwal

Description

@snktagarwal

Please answer these questions before submitting your issue.

What version of gRPC are you using?

1.5.1

What version of Go are you using (go version)?

go version go1.8.1 darwin/amd64

What operating system (Linux, Windows, …) and version?

Mac

What did you do?

If possible, provide a recipe for reproducing the error.
Server running a duplex connection. Simple connection establishment, and tear down by client.

Here's the skeleton of the code:

func (s *speechDataServer) SpeechProxyRecognize(stream pb.SpeechProxyService_SpeechProxyRecognizeServer) error {
	msg0, _ := stream.Recv()

	log.Printf("Stream initiated conf: %+v\n", conf)

	return nil
}

What did you expect to see?

No Thread leak

What did you see instead?

Pprof sees this:

14 @ 0x102c2aa 0x103b504 0x103a16c 0x13975c6 0x13a9489 0x1057fb1
#	0x13975c5	vendor/google.golang.org/grpc.(*addrConn).transportMonitor+0xa15	/go/src/vendor/google.golang.org/grpc/clientconn.go:942
#	0x13a9488	vendor/google.golang.org/grpc.(*ClientConn).resetAddrConn.func1+0x1d8	/go/src/vendor/google.golang.org/grpc/clientconn.go:640

Every RPC call shows such a thread leak

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions