Git Product home page Git Product logo

Comments (7)

howardjohn avatar howardjohn commented on August 16, 2024

Did a few discussions with folks about various risks and tradeoffs

The biggest concerns are around a gogo 2.0 that can't be ripped out easily.
This library is fundamentally different, and intentionally avoids this issue.
Calling looks like this: https://github.com/vitessio/vitess/blob/40f314c1d052db3fa5a52e5fb2ddd2bddaefde44/go/vt/servenv/grpc_codec.go#L40-L49, so there is no code changes required if its removed later. Theoretically you could break yourself, but you would have to use the library in a poor way to do so.
The original proto Go struct is unmodified.

From the internal protobuf side, I am not sure how much of the details I can discuss publicly, but there was not concerns in adoption of vtprotobuf.

from go-control-plane.

dfawley avatar dfawley commented on August 16, 2024

Calling looks like this: vitessio/vitess@40f314c/go/vt/servenv/grpc_codec.go#L40-L49, so there is no code changes

That's what calling code should look like. And what happens when an important project writes the equivalent of:

func (vtprotoCodec) Marshal(v any) ([]byte, error) {
	return v.(vtprotoMessage).MarshalVT() // panics if the proto doesn't support vtprotoMessage
}

Removing vtproto would be a breaking change.

from go-control-plane.

howardjohn avatar howardjohn commented on August 16, 2024

Calling looks like this: vitessio/vitess@40f314c/go/vt/servenv/grpc_codec.go#L40-L49, so there is no code changes

That's what calling code should look like. And what happens when an important project writes the equivalent of:

func (vtprotoCodec) Marshal(v any) ([]byte, error) {
	return v.(vtprotoMessage).MarshalVT() // panics if the proto doesn't support vtprotoMessage
}

Removing vtproto would be a breaking change.

You can go down this rabbit hole with any API really. Someone can always use reflect or unsafe to pull out data from private fields, or other crazy shenanigans.

If someone goes out of there way to shoot themselves in the foot, I don't see any issue with breaking them -- it would be far less of a breaking change than go-control-plane has made numerous times over the years as well (not reason to do it again, but still).

Also see build tag discussion in envoyproxy/envoy#31172 (comment)

from go-control-plane.

dfawley avatar dfawley commented on August 16, 2024

These aren't private fields, and my example does not use reflection or unsafe. These are exported methods, and removing them is going to be seen as less "okay".

The issue with "just break people who do bad things" is: when you work for a big company (e.g. Google) and someone imports the project doing bad things into your codebase, you might not be able to upgrade your thing without fixing the people that did the bad things first.

If this can go in with a build flag that is opt-in instead of opt-out, that would probably remove all of my concerns.

from go-control-plane.

howardjohn avatar howardjohn commented on August 16, 2024

If this can go in with a build flag that is opt-in instead of opt-out, that would probably remove all of my concerns.

This is my plan, need to merge planetscale/vtprotobuf#122 first though

from go-control-plane.

github-actions avatar github-actions commented on August 16, 2024

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

from go-control-plane.

github-actions avatar github-actions commented on August 16, 2024

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

from go-control-plane.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.