You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by "Jens-G (via GitHub)" <gi...@apache.org> on 2026/09/16 21:49:31 UTC

[PR] THRIFT-6280: Pass the current TConfiguration on from THeaderTransportFactory [thrift]

Jens-G opened a new pull request, #3872:
URL: https://github.com/apache/thrift/pull/3872

   JIRA: [THRIFT-6280](https://issues.apache.org/jira/browse/THRIFT-6280)
   Client: go
   
   `THeaderTransportFactory` in `lib/go/thrift/header_transport.go` did not pass its `TConfiguration` on the way the framed transport factory does:
   - `SetTConfiguration` propagated `f.cfg`, the configuration the factory held before, instead of `cfg`, the one it was given. The wrapped factory therefore always lagged one update behind.
   - `NewTHeaderTransportFactoryConf` did not propagate the configuration to the wrapped factory at all.
   
   ### Change
   
   - `NewTHeaderTransportFactoryConf` and `SetTConfiguration` both propagate the given configuration to the wrapped factory, as `NewTFramedTransportFactoryConf` and `tFramedTransportFactory.SetTConfiguration` do.
   - `GetTransport` also 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 through `NewTHeaderTransportConf`.
   - The deprecated `NewTHeaderTransportFactory` uses a configuration marked `noPropagation`, so it still passes nothing on.
   
   ### Tests
   
   New cases in `header_transport_test.go`, using a recording factory and transport:
   - `TestTHeaderTransportFactoryConfPropagation` checks the configuration:
     - after construction, on the wrapped factory;
     - after `GetTransport`, on the transport handed in, on the wrapped transport and on the header transport;
     - after `PropagateTConfiguration(factory, updated)`, on the wrapped factory and on the next transport.
   - `TestTHeaderTransportFactoryWithoutConf` checks that the deprecated constructor passes nothing on.
   
   Results:
   - **Unmodified library:** three assertions fail. Nothing reached the wrapped factory at construction or the transport handed in, and the wrapped factory held the old configuration after the update.
   - **Mutations:** removing each of the three changes in turn fails one assertion.
   - **Checks:** `go vet -stdmethods=false` and `go test -race ./thrift` pass with Go 1.26 and 1.27, and `GOARCH=386` vet 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](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] THRIFT-6280: Pass the current TConfiguration on from THeaderTransportFactory [thrift]

Posted by "Jens-G (via GitHub)" <gi...@apache.org>.
Jens-G merged PR #3872:
URL: https://github.com/apache/thrift/pull/3872


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org