You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across a pretty gnarly issue with PATCH requests and our HTTP/gRPC server… #2681 added a PATCH endpoint to the user-configurable overrides, while this endpoint works fine in tests it does not work on the full Tempo app. Instead, PATCH requests are immediately terminated:
I’ve been digging through the server code and the setting server.RouteHTTPToGRPC is at the root of this. We use this to serve HTTP and gRPC traffic on one endpoint. If I disable it, PATCH requests works fine.
Digging a bit deeper, this setting sets up a mux to route HTTP and gRPC requests to their respective listeners. It uses cmux.HTTP1Fast() to determine if the request is a HTTP requests:
Describe the bug
I came across a pretty gnarly issue with PATCH requests and our HTTP/gRPC server… #2681 added a PATCH endpoint to the user-configurable overrides, while this endpoint works fine in tests it does not work on the full Tempo app. Instead, PATCH requests are immediately terminated:
I’ve been digging through the server code and the setting
server.RouteHTTPToGRPC
is at the root of this. We use this to serve HTTP and gRPC traffic on one endpoint. If I disable it, PATCH requests works fine.Digging a bit deeper, this setting sets up a mux to route HTTP and gRPC requests to their respective listeners. It uses
cmux.HTTP1Fast()
to determine if the request is a HTTP requests:tempo/vendor/github.com/weaveworks/common/server/server.go
Lines 256 to 261 in 8e4b812
https://github.com/weaveworks/common/blob/dd9e68f319d5ddfb68002a238d481265af23fa3b/server/server.go#L256-L261
The implementation of
cmux.HTTP1Fast()
only looks at the method of a request and matches it with a hard coded list... which does not have PATCH.tempo/vendor/github.com/soheilhy/cmux/matchers.go
Lines 46 to 64 in 8e4b812
https://github.com/soheilhy/cmux/blob/master/matchers.go#L46-L64
The solution would be to change the mux setup in weaveworks/common/server:
Or
To Reproduce
Steps to reproduce the behavior:
curl -v -X PATCH http://localhost:3200/api/overrides --data '{}'
Expected behavior
PATCH requests are accepted and processed correctly:
Environment:
Additional Context
The text was updated successfully, but these errors were encountered: