Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

events: cannot be used as a library #481

Open
buchanae opened this issue Feb 3, 2018 · 4 comments
Open

events: cannot be used as a library #481

buchanae opened this issue Feb 3, 2018 · 4 comments

Comments

@buchanae
Copy link
Contributor

buchanae commented Feb 3, 2018

events imports grpc, and grpc does something with net/http. Since we vendor grpc (rightly so, it releases breaking changes frequently), importing events from an external codebase causes a panic:

panic: http: multiple registrations for /debug/requests

goroutine 1 [running]:
net/http.(*ServeMux).Handle(0xe49680, 0xaea1a8, 0xf, 0xdf5020, 0xb05748)
	/usr/local/go/src/net/http/server.go:2254 +0x610
net/http.(*ServeMux).HandleFunc(0xe49680, 0xaea1a8, 0xf, 0xb05748)
	/usr/local/go/src/net/http/server.go:2286 +0x55
net/http.HandleFunc(0xaea1a8, 0xf, 0xb05748)
	/usr/local/go/src/net/http/server.go:2298 +0x4b
github.com/ohsu-comp-bio/funnel/vendor/golang.org/x/net/trace.init.1()
	/home/ubuntu/src/github.com/ohsu-comp-bio/funnel/vendor/golang.org/x/net/trace/trace.go:115 +0x42
github.com/ohsu-comp-bio/funnel/vendor/golang.org/x/net/trace.init()
	/home/ubuntu/src/github.com/ohsu-comp-bio/funnel/vendor/golang.org/x/net/trace/trace_go17.go:22 +0x1cd
github.com/ohsu-comp-bio/funnel/vendor/google.golang.org/grpc.init()
	/home/ubuntu/src/github.com/ohsu-comp-bio/funnel/vendor/google.golang.org/grpc/trace.go:114 +0x9b
github.com/ohsu-comp-bio/funnel/proto/tes.init()
	/home/ubuntu/src/github.com/ohsu-comp-bio/funnel/proto/tes/validate.go:95 +0x67
github.com/ohsu-comp-bio/funnel/events.init()
	/home/ubuntu/src/github.com/ohsu-comp-bio/funnel/events/writer.go:34 +0x64
main.init()
	/home/ubuntu/src/github.com/bmeg/arachne/import.go:58 +0x4e

I am so tired of grpc's issues. This is not going to be easy to solve.

One idea is to break the events writers into separate packages. We could introduce and rpc package and move all grpc code there. Other packages would define interfaces so they don't need to import grpc.

@buchanae
Copy link
Contributor Author

buchanae commented Feb 3, 2018

Another idea is to nuke grpc and hope this issue goes away.

@adamstruck
Copy link
Contributor

looks like this isn't grpc specific, but due to vendoring golang.org/x/net/trace.

grpc/grpc-go#566

@kellrott
Copy link
Contributor

kellrott commented Feb 5, 2018

So unvendoring golang.org/x/net/trace should fix it? Does it change infrequently enough?

@buchanae
Copy link
Contributor Author

buchanae commented Feb 5, 2018

Ah, ok, that's good actually. We shouldn't be vendoring anything under golang.org, we can trust that enough. We should drop the vendetta tools, so this problem doesn't come back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants