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
We should use an ocis-pkg/chi RegisterMethodOnce(method string) function that executes the chi call once per method. That would be a cleaner solution than the MethodNotAllowed workaround: we can then propery register routes ... or we submit an upstream Fix, duh ...
chi.RegisterMethod writes to a global map. Other parts of chi read that map and since we start multiple chi router in different goroutines we concurrently read/write to the map which is not valid and results in panics
These other parts are Method and MethodFunc calls, which try to read from the global map. Depending on the order in which services are started the webdav or proxy service might write to the chi methodMap while another service is trying to register a route and as a result reading from the methodMap in setEndpoint ...
We should use an
ocis-pkg/chi RegisterMethodOnce(method string)
function that executes the chi call once per method. That would be a cleaner solution than theMethodNotAllowed
workaround: we can then propery register routes ... or we submit an upstream Fix, duh ...Related:
Our current workaround might have sideeffects in the future: go-chi/chi#776
Hm from the original workaround in #3662:
These other parts are Method and MethodFunc calls, which try to read from the global map. Depending on the order in which services are started the webdav or proxy service might write to the chi
methodMap
while another service is trying to register a route and as a result reading from themethodMap
in setEndpoint ...hm, the chi examples just use init:
https://github.com/go-chi/chi/blob/master/_examples/custom-method/main.go
The text was updated successfully, but these errors were encountered: