Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

Add access to upstreamfilterstate in WasmStateWrapper #394

Merged
merged 2 commits into from
Feb 6, 2020

Conversation

gargnupur
Copy link
Contributor

@gargnupur gargnupur commented Feb 5, 2020

For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md
Add access to upstreamfilterstate in WasmStateWrapper

Description:
Risk Level:
Ref: istio/istio#20802
Testing: Tested E2E in istio/proxy
Docs Changes:
Release Notes:
[Optional Fixes #Issue]
[Optional Deprecated:]

@gargnupur
Copy link
Contributor Author

/cc @mandarjog @bianpengyuan

}

if (upstream_connection_filter_state_ &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the outcome of the discussion for the fallback of the filter state to upstream connection filter state?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think we discussed that...
https://github.com/envoyproxy/envoy/pull/9202/files PR added sustaining filterstate to downstream connection lifespan and then I added this envoyproxy/envoy#9896 to share filterstate between upstream and downstream filters.
I see your point that we will suffer from the problem, what if upstream connection closes before downstream connection, then in that case upstream filterstate will be invalid. Is it possible for that to happen?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a shared_ptr so the state will outlive the upstream connection. But we should be careful to clear it in the wasm context eventually.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My question was about filter_state itself falling through to upstream connection filter state. E.g. make it try HTTP, downstream TCP, then upstream TCP.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, didnt try to make filter_state itself fall through to upstream TCP

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked offline.. will simplify in a different pr..

Copy link
Contributor

@kyessenov kyessenov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG. A question for my own education.

@gargnupur
Copy link
Contributor Author

/retest

Signed-off-by: gargnupur <gargnupur@google.com>
@@ -239,6 +239,12 @@ void Filter::initialize(Network::ReadFilterCallbacks& callbacks, bool set_connec
getStreamInfo().setDownstreamLocalAddress(read_callbacks_->connection().localAddress());
getStreamInfo().setDownstreamRemoteAddress(read_callbacks_->connection().remoteAddress());
getStreamInfo().setDownstreamSslConnection(read_callbacks_->connection().ssl());
read_callbacks_->connection().streamInfo().setDownstreamLocalAddress(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this being upstreamed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will after getting feedback from our team...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jplevyak : John removed tcp proxy change her and added to envoy only first, will merge here after that... envoyproxy/envoy#9949

Can you please help merge this PR?

@gargnupur gargnupur changed the title Add access to upstreamfilterstate in WasmStateWrapper and fix https://github.com/istio/istio/issues/20802 Add access to upstreamfilterstate in WasmStateWrapper Feb 6, 2020
Signed-off-by: gargnupur <gargnupur@google.com>
@jplevyak jplevyak merged commit b6d07b3 into envoyproxy:master Feb 6, 2020
bianpengyuan pushed a commit to bianpengyuan/envoy-wasm that referenced this pull request Feb 8, 2020
Add access to upstreamfilterstate in WasmStateWrapper
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants