Repository navigation
Update Envoy SHA to 07-12. - #3395
Conversation
|
I think you can undo new connection pool override in https://github.com/istio/proxy/pull/3376/files |
|
🤔 🐛 You appear to be fixing a bug in Go code, yet your PR doesn't include updates to any test files. Did you forget to add a test? Courtesy of your friendly test nag. |
f49e239 to
ef9fae1
Compare
|
@kyessenov I am not sure how I look at the test, it simulates a middle proxy with both inbound and outbound listener configured without metadata exchange, but how does server/client access log ever gets peer metadata? Is the dynamic metadata somehow preserved across streams? |
|
@bianpengyuan I think there is metadata exchange but they are both installed in the same proxy so source and destination are the same? Stream metadata could be preserved, it depends on how we configured it. I think it should be per-request now but it's been awhile I looked into it. |
|
@kyessenov Ah yeah sorry, misread the code. Turns out the MX filter always consider itself outbound regardless of which listener it is on, and it happens after envoyproxy/envoy@5a8f89a. @mathetake Could you please take a look? metadata exchange filter get direction information with property API: proxy/extensions/common/context.cc Line 208 in 3a9cc09 |
|
OK let me take a look in a few days |
|
ok it looks like the test has depended on the bag I fixed in that PR. When I looked thorough the log, I see that the exactly the same configuration both for inbound/outbound mx filter: outbound inbound which results in using the same plugin first created. This is the expected behavior. I would recommend to set different root_id or vm_id for each of them, and believe that would fix the test. |
|
^ cc @PiotrSikora |
@mathetake we originally had separated root_id/vm_id for inbound and outbound MX filters, in order to get the correct listener direction. Current behavior was considered as a "bug" and fixed, so that Wasm filter can get the listener context that it is on. It feels unnecessary to have different root / VM to just differentiate listener direction. There can be other listener properties, and I don't think we want to have different root context for each of them? It might be fine for us, but likely this will be surprised to the Wasm filter developers. |
yeah actually it is unnecessary if you use This is the root cause here. (stackdriver also uses getProperty in ::configure so same goes for it.)
This is by the original design of native Proxy-Wasm filters that a single in-VM plugin can be used at multiple extension points of the host implementation. But yeah we should reconsider this "original" behavior since as you said this is confusing and error-prone. Please refer to @PiotrSikora's comment here proxy-wasm/proxy-wasm-cpp-host#175 (comment) |
|
ah - I misread the code, |
|
update: successfully reproduced with Go SDK + a small Envoy config - dig into now. |
|
OK I found the root cause |
|
So I raised a PR in Envoy envoyproxy/envoy#17243 . It was much more complex than I thought, and I think it's going to take some time to land. Thanks. |
|
@mathetake We have several fixes after the Wasm change that need to land. Do you think we need a deprecation flag to guard your change or we can get your fix PR soon? |
|
I think the fix can get merged soon though the stackdriver extension needs to be revised accordingly - I see that it caches the direction in root context: https://github.com/istio/proxy/blob/master/extensions/stackdriver/stackdriver.cc#L379. But it all depends on how @PiotrSikora review the PR. |
This is the follow up on #16795. ## Bug description If the same plugin/rootcontext is shared across multiple listeners, then there is a race in listener information. Before #16795, this was not a problem for stream contexts since given listener information is from *where* it is created (`Plugin: plugin_` member created in the factory instance) https://github.com/envoyproxy/envoy/pull/16795/files#diff-90e133f83d91e5c22d1f7c7e8c0cf8017536a23765978bf81c7efd0482be0d81L43 But after that being merged, the `Plugin` passed to stream context constructor is the one from `PluginHandle::plugin()` which is potentially shared across multiple listeners. For root contexts, this has been a problem since the beginning because the root context has been already potentially shared across multiple listeners, and pointing to the listener's info which is created first. ## Change in this PR Combined with proxy-wasm/proxy-wasm-cpp-host#178, we explicitly include listener information into the plugin key so that if two plugins have different info to each other, different plugin instances will be created. ## Note - Maybe we could drop the support for sharing 1 Plugin across multiple listeners (or filters), then this race condition would be resolved in a different way. I think it is worth discussion. - This race is originally reported by Istio istio/proxy#3395 (comment) Signed-off-by: Takeshi Yoneda <[email protected]>
|
@bianpengyuan could you bump Envoy SHA? The Wasm fix was merged. |
|
/retest |
) This is the follow up on envoyproxy#16795. ## Bug description If the same plugin/rootcontext is shared across multiple listeners, then there is a race in listener information. Before envoyproxy#16795, this was not a problem for stream contexts since given listener information is from *where* it is created (`Plugin: plugin_` member created in the factory instance) https://github.com/envoyproxy/envoy/pull/16795/files#diff-90e133f83d91e5c22d1f7c7e8c0cf8017536a23765978bf81c7efd0482be0d81L43 But after that being merged, the `Plugin` passed to stream context constructor is the one from `PluginHandle::plugin()` which is potentially shared across multiple listeners. For root contexts, this has been a problem since the beginning because the root context has been already potentially shared across multiple listeners, and pointing to the listener's info which is created first. ## Change in this PR Combined with proxy-wasm/proxy-wasm-cpp-host#178, we explicitly include listener information into the plugin key so that if two plugins have different info to each other, different plugin instances will be created. ## Note - Maybe we could drop the support for sharing 1 Plugin across multiple listeners (or filters), then this race condition would be resolved in a different way. I think it is worth discussion. - This race is originally reported by Istio istio/proxy#3395 (comment) Signed-off-by: Takeshi Yoneda <[email protected]>
What this PR does / why we need it:
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close that issue when PR gets merged): fixes #Special notes for your reviewer: