On Wednesday, February 19, 2020 at 9:40:14 AM UTC-8, Moiz Haidry wrote:

> This is an effort to add more debugging capability to the gRPC core
> surface API.

During the PR, Vijay Pai mentioned [1] that the addition of the debug_string
member to the grpc_metadata_credentials_plugin is an API breaking change.
It's likely to affect callers who fail to initialize their automatic storage
duration grpc_metadata_credentials_plugin instances.

    // Callers like this will be unhappy: .debug_string will have an 
indeterminate value
    grpc_metadata_credentials_plugin plugin;
    plugin.get_metadata = &gm;
    plugin.destroy = &d;
    plugin.state = 42;
    plugin.type = "my cool plugin";
    
    creds = grpc_metadata_credentials_create_from_plugin(plugin, ...);

    // Callers like this will be fine, as .debug_string will be initialized 
to a null pointer
    grpc_metadata_credentials_plugin plugin2 = {
      .get_metadata = &gm,
      .destroy = &d,
      .state = 42,
      .type = "my cool plugin2",
    };

    creds = grpc_metadata_credentials_create_from_plugin(plugin2, ...);

Does that need to be captured in the proposal anywhere?

[1] https://github.com/grpc/grpc/pull/21984#discussion_r384061238

--
Christopher Warrington
Microsoft Corp.

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/11b3c6c8-6999-4ed5-8a6d-31a847c46414%40googlegroups.com.

Reply via email to