THRIFT-6280: Pass the current TConfiguration on from THeaderTransportFactory - #3872
Merged
Merged
Conversation
fishy
approved these changes
Sep 16, 2026
…Factory Client: go THeaderTransportFactory.SetTConfiguration handed the factory it wraps the configuration it held before, not the one it was given, and NewTHeaderTransportFactoryConf did not pass the configuration to the wrapped factory at all. Both now do what the framed transport factory does: the constructor and SetTConfiguration propagate the given configuration, and GetTransport also passes it to the transport it is handed before the wrapped factory builds on it. The deprecated NewTHeaderTransportFactory still keeps its configuration to itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JIRA: THRIFT-6280
Client: go
THeaderTransportFactoryinlib/go/thrift/header_transport.godid not pass itsTConfigurationon the way the framed transport factory does:SetTConfigurationpropagatedf.cfg, the configuration the factory held before, instead ofcfg, the one it was given. The wrapped factory therefore always lagged one update behind.NewTHeaderTransportFactoryConfdid not propagate the configuration to the wrapped factory at all.Change
NewTHeaderTransportFactoryConfandSetTConfigurationboth propagate the given configuration to the wrapped factory, asNewTFramedTransportFactoryConfandtFramedTransportFactory.SetTConfigurationdo.GetTransportalso passes the configuration to the transport it is handed before the wrapped factory builds on it, as the framed factory does. The transport the wrapped factory returns already received it throughNewTHeaderTransportConf.NewTHeaderTransportFactoryuses a configuration markednoPropagation, so it still passes nothing on.Tests
New cases in
header_transport_test.go, using a recording factory and transport:TestTHeaderTransportFactoryConfPropagationchecks the configuration:GetTransport, on the transport handed in, on the wrapped transport and on the header transport;PropagateTConfiguration(factory, updated), on the wrapped factory and on the next transport.TestTHeaderTransportFactoryWithoutConfchecks that the deprecated constructor passes nothing on.Results:
go vet -stdmethods=falseandgo test -race ./thriftpass with Go 1.26 and 1.27, andGOARCH=386vet and tests pass as well.The test helpers have names of their own, so this PR does not collide with the ones #3861 adds to the same package.
🤖 Generated with Claude Code