Repository navigation
fix(datastore): reset auto-generated channelProvider on toBuilder mutations - #15415
jinseopkim0 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a hasCustomChannelProvider flag in DatastoreOptions to track whether the TransportChannelProvider was explicitly provided or auto-generated. This ensures that auto-generated providers are correctly cleared and rebuilt when configuration settings like host, transport options, universe domain, or OpenTelemetry options change. The review feedback correctly identifies a serialization issue where hasCustomChannelProvider is not marked as transient, which could lead to inconsistent state and stale endpoints after deserialization since channelProvider itself is transient.
|
@gemini-code-assist review |
There was a problem hiding this comment.
Code Review
This pull request introduces a hasCustomChannelProvider flag to DatastoreOptions to track whether a channel provider was explicitly supplied by the caller. This ensures that auto-generated channel providers are correctly cleared and rebuilt when configuration settings like transport options, host, universe domain, or OpenTelemetry options are modified. The review feedback suggests several improvements: adding null checks to prevent a potential NullPointerException when comparing transport options, and checking if the host, universe domain, or OpenTelemetry options have actually changed before clearing the channel provider to avoid unnecessary recreation.
b/588887355#comment11
Track whether
channelProviderwas explicitly configured onDatastoreOptionssotoBuilder()rebuilds auto-generated gRPC channel providers whensetHost(),setUniverseDomain(),setTransportOptions(), orsetOpenTelemetryOptions()is called.