-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
avoid reflection-based Transaction cloning #4383
Conversation
LGTM Reviewed 12 of 12 files at r1. Comments from the review on Reviewable.io |
LGTM (whether or not you want to wrap |
This reverts commit 7cc27ae.
Also fixes existing bugs in make check.
Wrapper is ready, you guys are gonna wanna take another look at this. 💣🔍 |
Review status: 8 of 24 files reviewed at latest revision, 2 unresolved discussions. util/clone_proto.go, line 50 [r2] (raw file): util/clone_proto.go, line 57 [r2] (raw file): Comments from the review on Reviewable.io |
Review status: 8 of 24 files reviewed at latest revision, 2 unresolved discussions, some commit checks pending. util/clone_proto.go, line 50 [r2] (raw file): You're right, the problem is any array, not just uuid.UUID - I've made that change. util/clone_proto.go, line 57 [r2] (raw file): Comments from the review on Reviewable.io |
Review status: 8 of 24 files reviewed at latest revision, 2 unresolved discussions. util/clone_proto.go, line 50 [r2] (raw file): util/clone_proto.go, line 54 [r3] (raw file): Comments from the review on Reviewable.io |
Review status: 8 of 24 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. util/clone_proto.go, line 50 [r2] (raw file): For types which might contain arrays, I have to iterate over the value and see if it actually contains an array. util/clone_proto.go, line 54 [r3] (raw file):
Comments from the review on Reviewable.io |
Review status: 8 of 24 files reviewed at latest revision, 2 unresolved discussions. util/clone_proto.go, line 50 [r2] (raw file): util/clone_proto.go, line 54 [r3] (raw file): Comments from the review on Reviewable.io |
Reviewed 12 of 12 files at r1, 16 of 16 files at r2, 1 of 1 files at r3, 2 of 2 files at r4. Comments from the review on Reviewable.io |
I've optimized this further so that each type (including inner types) only gets traversed once (values may still be traversed many times). Review status: 23 of 24 files reviewed at latest revision, 2 unresolved discussions. util/clone_proto.go, line 50 [r2] (raw file): util/clone_proto.go, line 54 [r3] (raw file): The contents of the Comments from the review on Reviewable.io |
Review status: 23 of 24 files reviewed at latest revision, 2 unresolved discussions. util/clone_proto.go, line 50 [r2] (raw file): util/clone_proto.go, line 54 [r3] (raw file): Failing to clone would be the error (or is it a panic) you've seen when trying to clone a proto containing an array. But now that we've established that you're examining the value and not just the type I'm wondering what the utility is. If you call Comments from the review on Reviewable.io |
Review status: 23 of 24 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. util/clone_proto.go, line 54 [r3] (raw file): Comments from the review on Reviewable.io |
Review status: 23 of 24 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. util/clone_proto.go, line 54 [r3] (raw file): Comments from the review on Reviewable.io |
Review status: 23 of 24 files reviewed at latest revision, 1 unresolved discussion. util/clone_proto.go, line 54 [r3] (raw file): Comments from the review on Reviewable.io |
Provide a wrapper that panics if an attempt to clone a uuid.UUID is made.
LGTM Review status: 23 of 24 files reviewed at latest revision, 2 unresolved discussions. util/clone_proto.go, line 67 [r7] (raw file): Comments from the review on Reviewable.io |
Reviewed 1 of 1 files at r5. util/clone_proto.go, line 67 [r7] (raw file): Comments from the review on Reviewable.io |
Review status: 23 of 24 files reviewed at latest revision, 2 unresolved discussions. util/clone_proto.go, line 67 [r7] (raw file): Comments from the review on Reviewable.io |
avoid reflection-based Transaction cloning
This allows reverting the ugly hacks in util/uuid. See gogo/protobuf#147.