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

[Go] Panic when importing different versions of Arrow Flight in the same project (v12, v13) #37353

Open
phillipleblanc opened this issue Aug 24, 2023 · 1 comment

Comments

@phillipleblanc
Copy link
Contributor

Describe the bug, including details regarding any error messages, version, and platform.

Importing both github.com/apache/arrow/go/v12/arrow/flight and github.com/apache/arrow/go/v13/arrow/flight into the same project causes a panic on startup due to a protobuf namespace conflict:

panic: proto: file "Flight.proto" is already registered
	previously from: "github.com/apache/arrow/go/v12/arrow/flight/internal/flight"
	currently from:  "github.com/apache/arrow/go/v13/arrow/flight/internal/flight"
See https://protobuf.dev/reference/go/faq#namespace-conflict


goroutine 1 [running]:
google.golang.org/protobuf/reflect/protoregistry.glob..func1({0x3f49720?, 0xc000bfa010?}, {0x3f49720?, 0xc000bfa060})
	/go/pkg/mod/google.golang.org/protobuf@v1.31.0/reflect/protoregistry/registry.go:56 +0x1e5
google.golang.org/protobuf/reflect/protoregistry.(*Files).RegisterFile(0xc000012810, {0x3f9a3f8?, 0xc0013281c0?})
	/go/pkg/mod/google.golang.org/protobuf@v1.31.0/reflect/protoregistry/registry.go:130 +0x3a6
google.golang.org/protobuf/internal/filedesc.Builder.Build({{0x358b83d, 0x3b}, {0x5af6de0, 0xb4d, 0xb4d}, 0x2, 0x13, 0x0, 0x1, {0x3f567a8, ...}, ...})
	/go/pkg/mod/google.golang.org/protobuf@v1.31.0/internal/filedesc/build.go:112 +0x1d6
google.golang.org/protobuf/internal/filetype.Builder.Build({{{0x358b83d, 0x3b}, {0x5af6de0, 0xb4d, 0xb4d}, 0x2, 0x13, 0x0, 0x1, {0x0, ...}, ...}, ...})
	/go/pkg/mod/google.golang.org/protobuf@v1.31.0/internal/filetype/build.go:138 +0x199
github.com/apache/arrow/go/v13/arrow/flight/internal/flight.file_Flight_proto_init()
	/go/pkg/mod/github.com/apache/arrow/go/v13@v13.0.0/arrow/flight/internal/flight/Flight.pb.go:1792 +0x1b8
github.com/apache/arrow/go/v13/arrow/flight/internal/flight.init.0()
	/go/pkg/mod/github.com/apache/arrow/go/v13@v13.0.0/arrow/flight/internal/flight/Flight.pb.go:1543 +0xf

Component(s)

Go

@zeroshade
Copy link
Member

@phillipleblanc So, the only thing I can think of to try to solve this one would be to make the generated code from the .proto files a separate module and give it it's own go.mod file. That should let all the Arrow versions rely on a single version of the generated code. I'll take a look into seeing what the best route forward here would be.

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

No branches or pull requests

2 participants