[
https://issues.apache.org/jira/browse/THRIFT-6280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jens Geyer resolved THRIFT-6280.
--------------------------------
Fix Version/s: 0.25.0
Assignee: Jens Geyer
Resolution: Fixed
> Go: THeaderTransportFactory passes a stale TConfiguration to the factory it
> wraps
> ---------------------------------------------------------------------------------
>
> Key: THRIFT-6280
> URL: https://issues.apache.org/jira/browse/THRIFT-6280
> Project: Thrift
> Issue Type: Bug
> Components: Go - Library
> Reporter: Jens Geyer
> Assignee: Jens Geyer
> Priority: Minor
> Fix For: 0.25.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Found while working on THRIFT-6263.
> {{THeaderTransportFactory.SetTConfiguration}}
> ({{lib/go/thrift/header_transport.go}}):
> {code:go}
> func (f *THeaderTransportFactory) SetTConfiguration(cfg *TConfiguration) {
> PropagateTConfiguration(f.Factory, f.cfg)
> f.cfg = cfg
> }
> {code}
> It hands the wrapped factory the configuration it held before, not the one it
> was given. {{NewTHeaderTransportFactoryConf}} does not pass the configuration
> to the wrapped factory at all. The framed factory does both.
> Measured on master:
> # A factory built with {{MaxFrameSize: 1}} is updated with
> {{PropagateTConfiguration}} to {{MaxFrameSize: 2}}.
> # The wrapped factory then holds {{MaxFrameSize: 1}}.
> h2. Suggested
> Propagate {{cfg}} rather than {{f.cfg}}, propagate in
> {{NewTHeaderTransportFactoryConf}} as {{NewTFramedTransportFactoryConf}}
> does, and cover both with a test.
> _Drafted with AI assistance (Claude Opus 5); reviewed and filed by Jens
> Geyer._
--
This message was sent by Atlassian Jira
(v8.20.10#820010)