Routing: Add mutex for Attributes
temporarily
#3908
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
见 #3904
mmm似乎在inbound上遇到了类似的问题 这里的问题是content
问题还是老问题 对于一条被mux的连接 多个子请求在内部共享一条ctx
mmm的做法是在mux阶段创建一个深拷贝避免它们相互影响
这里更麻烦一些 因为content是在mux后面的dispatcher才被创建的 没法在mux处理 我也拿不定怎么搞 或许WithCancel另起一个新的ctx? 不是很敢乱动
说回这个issue 本质是多个连接都在尝试往content写入数据 当同时写入的时候遇到竞争就炸了 临时解决办法是加锁 这样好歹不会崩溃 但是并没有解决多个连接共享content的问题 这可能导致预期外的路由或者其他非规定行为