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

panic in proto merge when deep-copying server value #5691

Closed
a-palchikov opened this issue Feb 24, 2021 · 0 comments · Fixed by #5712
Closed

panic in proto merge when deep-copying server value #5691

a-palchikov opened this issue Feb 24, 2021 · 0 comments · Fixed by #5712

Comments

@a-palchikov
Copy link
Contributor

Description

What happened:
Very often, local integrations tests fail with:

panic: merger not found for type:int [recovered]
	panic: merger not found for type:int

goroutine 26 [running]:
testing.tRunner.func1.1(0xecb400, 0xc0003d43f0)
	/home/deemok/dev/go/go/src/testing/testing.go:1072 +0x30d
testing.tRunner.func1(0xc000103080)
	/home/deemok/dev/go/go/src/testing/testing.go:1075 +0x41a
panic(0xecb400, 0xc0003d43f0)
	/home/deemok/dev/go/go/src/runtime/panic.go:969 +0x1b9
github.com/gogo/protobuf/proto.(*mergeInfo).computeMergeInfo(0xc0003daa80)
	/home/deemok/go/src/github.com/gravitational/teleport-opt/vendor/github.com/gogo/protobuf/proto/table_merge.go:664 +0xfff
github.com/gogo/protobuf/proto.(*mergeInfo).merge(0xc0003daa80, 0xc0002eb760, 0xc0002267e0)
	/home/deemok/go/src/github.com/gravitational/teleport-opt/vendor/github.com/gogo/protobuf/proto/table_merge.go:113 +0x4d7
github.com/gogo/protobuf/proto.(*mergeInfo).computeMergeInfo.func27(0xc0003f27f0, 0x16e56b0)
	/home/deemok/go/src/github.com/gravitational/teleport-opt/vendor/github.com/gogo/protobuf/proto/table_merge.go:545 +0x386
github.com/gogo/protobuf/proto.(*mergeInfo).merge(0xc0003daa00, 0xc0003f27e0, 0x16e56a0)
	/home/deemok/go/src/github.com/gravitational/teleport-opt/vendor/github.com/gogo/protobuf/proto/table_merge.go:139 +0x49f
github.com/gogo/protobuf/proto.(*mergeInfo).computeMergeInfo.func30(0xc0002eb650, 0xc0002eb4b0)
	/home/deemok/go/src/github.com/gravitational/teleport-opt/vendor/github.com/gogo/protobuf/proto/table_merge.go:587 +0x5c
github.com/gogo/protobuf/proto.(*mergeInfo).merge(0xc0003da980, 0xc0002eb640, 0xc0002eb4a0)
	/home/deemok/go/src/github.com/gravitational/teleport-opt/vendor/github.com/gogo/protobuf/proto/table_merge.go:139 +0x49f
github.com/gogo/protobuf/proto.(*mergeInfo).computeMergeInfo.func30(0xc0003c6a68, 0xc0003c67e8)
	/home/deemok/go/src/github.com/gravitational/teleport-opt/vendor/github.com/gogo/protobuf/proto/table_merge.go:587 +0x5c
github.com/gogo/protobuf/proto.(*mergeInfo).merge(0xc0003da8c0, 0xc0003c6a30, 0xc0003c67b0)
	/home/deemok/go/src/github.com/gravitational/teleport-opt/vendor/github.com/gogo/protobuf/proto/table_merge.go:139 +0x49f
github.com/gogo/protobuf/proto.(*mergeInfo).computeMergeInfo.func28(0xc0003c6a30, 0xc0003c67b0)
	/home/deemok/go/src/github.com/gravitational/teleport-opt/vendor/github.com/gogo/protobuf/proto/table_merge.go:555 +0x3e
github.com/gogo/protobuf/proto.(*mergeInfo).merge(0xc0003da380, 0xc0003c6a00, 0xc0003c6780)
	/home/deemok/go/src/github.com/gravitational/teleport-opt/vendor/github.com/gogo/protobuf/proto/table_merge.go:139 +0x49f
github.com/gogo/protobuf/proto.(*InternalMessageInfo).Merge(0x16e46a0, 0x1140fc0, 0xc0003c6a00, 0x1140fc0, 0xc0003c6780)
	/home/deemok/go/src/github.com/gravitational/teleport-opt/vendor/github.com/gogo/protobuf/proto/table_merge.go:50 +0x4c
github.com/gravitational/teleport/api/types.(*ServerV2).XXX_Merge(0xc0003c6a00, 0x1140fc0, 0xc0003c6780)
	/home/deemok/go/src/github.com/gravitational/teleport-opt/vendor/github.com/gravitational/teleport/api/types/types.pb.go:580 +0x57
github.com/gogo/protobuf/proto.Merge(0x1140fc0, 0xc0003c6a00, 0x1140fc0, 0xc0003c6780)
	/home/deemok/go/src/github.com/gravitational/teleport-opt/vendor/github.com/gogo/protobuf/proto/clone.go:95 +0x346
github.com/gogo/protobuf/proto.Clone(0x1140fc0, 0xc0003c6780, 0x100b5b1, 0x5)
	/home/deemok/go/src/github.com/gravitational/teleport-opt/vendor/github.com/gogo/protobuf/proto/clone.go:52 +0x19b
github.com/gravitational/teleport/api/types.(*ServerV2).DeepCopy(...)
	/home/deemok/go/src/github.com/gravitational/teleport-opt/vendor/github.com/gravitational/teleport/api/types/server.go:351
...

The changes I made to mitigate another server test race by patching gogo implementation of proto.Clone does not seem to have the necessary effect.
The issue at hand is described here.

I'm going to rewrite the deep copy code without proto.Clone as it seems to be entirely unsuited for our needs.

What you expected to happen:
No panic.

Reproduction Steps

go test -count=1 ./integration/...
a-palchikov added a commit that referenced this issue Feb 25, 2021
manual implementation to avoid issues with proto-based type merge
panics.

Fixes #5691.
a-palchikov added a commit that referenced this issue Feb 26, 2021
manual implementation to avoid issues with proto-based type merge
panics.

Fixes #5691.
a-palchikov added a commit that referenced this issue Mar 4, 2021
manual implementation to avoid issues with proto-based type merge
panics.

Fixes #5691.
russjones pushed a commit that referenced this issue Mar 12, 2021
manual implementation to avoid issues with proto-based type merge
panics.

Fixes #5691.
russjones pushed a commit that referenced this issue May 1, 2021
manual implementation to avoid issues with proto-based type merge
panics.

Fixes #5691.
russjones pushed a commit that referenced this issue May 1, 2021
manual implementation to avoid issues with proto-based type merge
panics.

Fixes #5691.
This was referenced May 1, 2021
russjones pushed a commit that referenced this issue May 4, 2021
manual implementation to avoid issues with proto-based type merge
panics.

Fixes #5691.
russjones pushed a commit that referenced this issue May 4, 2021
manual implementation to avoid issues with proto-based type merge
panics.

Fixes #5691.
inertial-frame pushed a commit that referenced this issue May 6, 2021
manual implementation to avoid issues with proto-based type merge
panics.

Fixes #5691.
inertial-frame pushed a commit that referenced this issue May 6, 2021
manual implementation to avoid issues with proto-based type merge
panics.

Fixes #5691.
inertial-frame pushed a commit that referenced this issue May 6, 2021
manual implementation to avoid issues with proto-based type merge
panics.

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

Successfully merging a pull request may close this issue.

1 participant