dubbo_proxy: Redefine DecoderFilter interface and add EncoderFilter support#7118
Conversation
|
@lizan the author requested a review from you, but do you prefer to have a non-senior maintainer read it first? @gengleilei drive-by comment: this meaty PR probably deserves more content in the description. Why is the DecoderFilter being redefined, and why is there now a need for an EncoderFilter? |
|
/assign @zyfjeff |
6a505aa to
128e382
Compare
|
@jmarantz sorry, I've added some more detailed instructions on redefining DecoderFilter and supporting EncoderFilter. |
|
@lizan I'm sorry, recently a little busy, I will be review recently |
There was a problem hiding this comment.
ActiveMessageDecoderFilter and ActiveMessagerEncodeFilter will use dual-filter.
There was a problem hiding this comment.
Why remove
Downstream half closed, does it need to wait for the response of the upstream?
There was a problem hiding this comment.
sorry, the code was deleted by mistake while merging, I have restored it.
There was a problem hiding this comment.
Please add EncoderFilter unit tests
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
128e382 to
223c493
Compare
|
/retest |
|
🤷♀️ nothing to rebuild. |
There was a problem hiding this comment.
Why doesn't care about the return value for onData here?
There was a problem hiding this comment.
At present, when Decoder processes data, it either finishes processing or needs to wait until the data is entered, so there is no stop.
There was a problem hiding this comment.
ASSERT(context)? Why do you want to take raw pointer here?
There was a problem hiding this comment.
sorry,there is no need to convert, this part is left out when modify the code.
|
/wait |
There was a problem hiding this comment.
I can't append data to a buffer?
There was a problem hiding this comment.
yes, at present, I haven't thought of any scenarios that require append data, and I can let go of this restriction if necessary.
There was a problem hiding this comment.
remove static_cast, don't use raw point here
There was a problem hiding this comment.
Why not use class? this class is not a simple POD type, also contains some virtual method
There was a problem hiding this comment.
Because it's simple, you don't need to actively add public declarations.
There was a problem hiding this comment.
I think here should use the class, this is not a simple POD type. Can't go to easy access to the data members of the break of object-oriented rules
7c266f8 to
e84dda6
Compare
|
Please merge the master to resolve conflicts |
There was a problem hiding this comment.
route_matcher_ = Router::NamedRouteMatcherConfigFactory::getFactory(type).createRouteMatcher( config.route_config(), context);
There was a problem hiding this comment.
const cannot be used here because it changes the value of message_origin_buffer_ in the Context, as used in the onMessageDecoded function:
upstream_request_buffer_.move(ctx->message_origin_data(), ctx->message_size());
There was a problem hiding this comment.
It cannot be deleted here because the static_cast is needed to complete the conversion of the base class reference to the derived class reference, which will fail to compile after deletion.
There was a problem hiding this comment.
Downcasting, Should use dynamic_cast and judge whether the result is nullptr after the cast, rather than use staic_cast directly
There was a problem hiding this comment.
ASSERT(itor != routeMatcherNameMap.end())
return itor->second;
There was a problem hiding this comment.
ASSERT(itor != protocolSerializerTypeNameMap.end())
return itor->second;
There was a problem hiding this comment.
ASSERT(itor != serializerTypeNameMap.end())
return itor->second;
There was a problem hiding this comment.
ASSERT(itor != protocolTypeNameMap.end())
return itor->second;
There was a problem hiding this comment.
To be compatible with the internal HSF protocol, both HSF and Dubbo define SerializationType, but with different values.
There was a problem hiding this comment.
remove optional? The method name why will not exist?
|
/ wait |
e84dda6 to
550ae32
Compare
|
/ wait |
Signed-off-by: leilei.gll <leilei.gll@alibaba-inc.com>
Signed-off-by: leilei.gll <leilei.gll@alibaba-inc.com>
Signed-off-by: leilei.gll <leilei.gll@alibaba-inc.com>
Signed-off-by: leilei.gll <leilei.gll@alibaba-inc.com>
Signed-off-by: leilei.gll <leilei.gll@alibaba-inc.com>
Signed-off-by: leilei.gll <leilei.gll@alibaba-inc.com>
88a08f1 to
a5ce22a
Compare
|
@lizan Please help to review, thanks. |
| ASSERT(encoder_filter_action_ != nullptr); | ||
|
|
||
| if (!local_response_sent_) { | ||
| std::list<ActiveMessageEncoderFilterPtr>::iterator entry = commonEncodePrefix(filter, state); |
There was a problem hiding this comment.
put this in the for statement below?
| Buffer::Instance& buffer) const override { | ||
| ASSERT(buffer.length() == 0); | ||
|
|
||
| ENVOY_LOG(debug, "err {}", what()); |
There was a problem hiding this comment.
make the log message more descriptive?
| ~RpcResultImpl() override = default; | ||
|
|
||
| bool hasException() const override { return has_exception_; } | ||
| void SetException(bool has_exception) { has_exception_ = has_exception; } |
| virtual ResponseStatus responseStatus() const PURE; | ||
| virtual ~RpcResult() = default; | ||
| virtual bool hasException() const PURE; | ||
| virtual bool hasValue() const PURE; |
There was a problem hiding this comment.
sorry,hasValue function is not used, I have deleted it.
Signed-off-by: leilei.gll <leilei.gll@alibaba-inc.com>
Description: Redefine DecoderFilter interface and add EncoderFilter support
Risk Level: low
Testing: unit test
Docs Changes: N/A
Release Notes: N/A
[Optional Fixes #Issue]
[Optional Deprecated:]
Redefining DecoderFilter is mainly for 2 reasons:
As mentioned above, we merged the internal and open source versions. EncoderFilter is currently needed internally, such as the retry mechanism. we will consider adding more features to Dubbo later, similar to HTTP, so EncoderFilter is also necessary. we want to bring more features to users around Dubbo.