-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: only propagate FTL headers #3358
fix: only propagate FTL headers #3358
Conversation
internal/rpc/headers/headers.go
Outdated
var headers = []string{DirectRoutingHeader, VerbHeader, RequestIDHeader, ParentRequestIDHeader} | ||
|
||
// CopyRequest creates a new request with the same message as the original, but with only the FTL specific headers | ||
func CopyRequest[T any](req *connect.Request[T]) *connect.Request[T] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit, this sounds like a complete copy rather than what it is? Maybe CopyRequestForForwarding
?
backend/controller/controller.go
Outdated
@@ -853,7 +853,7 @@ func (s *Service) AcquireLease(ctx context.Context, stream *connect.BidiStream[f | |||
} | |||
|
|||
func (s *Service) Call(ctx context.Context, req *connect.Request[ftlv1.CallRequest]) (*connect.Response[ftlv1.CallResponse], error) { | |||
return s.callWithRequest(ctx, req, optional.None[model.RequestKey](), optional.None[model.RequestKey](), "") | |||
return s.callWithRequest(ctx, headers.CopyRequest(req), optional.None[model.RequestKey](), optional.None[model.RequestKey](), "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
80e8d89
to
244adf6
Compare
This isn't going to break OTEL tracing is it? |
Actually that is a good point, the logic should probably be to strip protocol level headers rather than just preserving known ones. |
No description provided.