Skip to content

dubbo_proxy: Refactor the DubboProxy filter#6410

Merged
lizan merged 16 commits intoenvoyproxy:masterfrom
gengleilei:feature-refactor-filter-ex
Apr 12, 2019
Merged

dubbo_proxy: Refactor the DubboProxy filter#6410
lizan merged 16 commits intoenvoyproxy:masterfrom
gengleilei:feature-refactor-filter-ex

Conversation

@gengleilei
Copy link
Copy Markdown
Contributor

@gengleilei gengleilei commented Mar 28, 2019

Description: Refactor the DubboProxy filter
Risk Level: low
Testing: unit test
Docs Changes: inline
Release Notes: add routing capabilities for the Dubbo protocol
[Optional Fixes #Issue] #3998
[Optional Deprecated:]

@gengleilei gengleilei requested a review from lizan as a code owner March 28, 2019 07:22
@gengleilei
Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

🙀 failed invoking rebuild of ci/circleci: compile_time_options: 500 Internal Server Error
🙀 failed invoking rebuild of ci/circleci: clang_tidy: 500 Internal Server Error
🙀 failed invoking rebuild of ci/circleci: coverage: 500 Internal Server Error

🐱

Caused by: a #6410 (comment) was created by @gengleilei.

see: more, trace.

@lizan lizan self-assigned this Mar 28, 2019
@lizan lizan requested a review from zyfjeff March 28, 2019 23:44
@zyfjeff
Copy link
Copy Markdown
Member

zyfjeff commented Mar 29, 2019

Code coverage 97.4 is lower than limit of 97.5

https://circleci.com/gh/envoyproxy/envoy/190601?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

Improve the code coverage, please

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the relationship between response_success_ and response_exception_ stats?

When message_type equal MessageType::Exception, is it possible that response_status equal OK ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Response_status == OK only means that the Dubbo framework handled the request correctly. The RpcResponseType represents the result of the business layer's processing of the request. ResponseWithException means that the business layer threw an exception when processing the request, response_exception_ is used to count exceptions thrown by the business layer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes,it possible.

@zyfjeff
Copy link
Copy Markdown
Member

zyfjeff commented Mar 29, 2019

Add related doc and release note, please

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not check status in other filter callbacks?
What if I return StopIteration in other filter callbacks?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  1. this is because StopIteration is most likely to occur in the messageEnd callback, where the user is already presented with enough information to satisfy routing requirements.
  2. if StopIteration is returned in other filter callback, the decoder will stop decoding unless the continueDecoding interface is called.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this check should be done in the last filter callback, not here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The applyDecoderFilters checking has been moved to the last filter callback.

Copy link
Copy Markdown
Member

@zyfjeff zyfjeff Apr 1, 2019

Choose a reason for hiding this comment

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

Why not call this method in the last filter callback?
What should I do if I reject the current request in the last filter callback?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  1. since the Decoder has decoded the request data at this time, the statistical item in finalizeRequest function is specific to the request.
  2. if StopIteration is returned in other filter callback, the decoder will stop decoding unless the continueDecoding interface is called.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if a local reply is made in last filter callback, is this request still valid? If it is not valid, the finalizeRequest will perform stats statistics.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If the last filter has a local reply, who is responsible for the deferred ActiveMessage?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The finalizeRequest call has been moved to the last filter callback.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where to use?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's useless. I deleted it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

route is shared_ptr, you can copy it directly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

s/3/6/g

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

s/5/3/g

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

s/5/3/g

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Alphabetical order

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@gengleilei gengleilei force-pushed the feature-refactor-filter-ex branch from 1a2f832 to 21a3b43 Compare April 4, 2019 06:21
@gengleilei
Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

🔨 rebuilding ci/circleci: coverage (failed build)

🐱

Caused by: a #6410 (comment) was created by @gengleilei.

see: more, trace.

@gengleilei
Copy link
Copy Markdown
Contributor Author

@zyfjeff Is there any other code review opinion ?

* config: use Envoy cpuset size to set the default number or worker threads if :option:`--cpuset-threads` is enabled.
* config: added support for :ref:`initial_fetch_timeout <envoy_api_field_core.ConfigSource.initial_fetch_timeout>`. The timeout is disabled by default.
* cors: added :ref:`filter_enabled & shadow_enabled RuntimeFractionalPercent flags <cors-runtime>` to filter.
* dubbo_proxy: add routing capabilities for the Dubbo protocol.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

dubbo_proxy: Support dubbo proxy filter?

This is the first appearance of dubbo proxy.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good, i have modified it.


DecoderEventHandler& handler_;
};
typedef std::unique_ptr<ActiveRequest> ActiveRequestPtr;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Protocol& protocol_;
DecoderStateMachinePtr state_machine_;
bool decode_started_ = false;
DecoderCallbacks* decoder_callbacks_;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If decoder_callbacks_ is not nullptr, it should be referenced here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@zyfjeff
Copy link
Copy Markdown
Member

zyfjeff commented Apr 8, 2019

LGTM, just some nits
@lizan take a look when you have time

Copy link
Copy Markdown
Member

@lizan lizan left a comment

Choose a reason for hiding this comment

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

Apologize for delay, assuming @zyfjeff takes thorough review on the logic itself, some C++/style comments only.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

use macro

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you merge master and bump this to 1.11?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

absl::flat_hash_map? (ditto below)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

unused?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've deleted it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This file has slightly low coverage:
https://195194-65214191-gh.circle-artifacts.com/0/coverage/coverage.source_extensions_filters_network_dubbo_proxy_config.cc.html

can you add test for failure case? If they are validated via PGV, then just ASSERT is enough.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, ASSERT is enough, i have modified it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: constexpr

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The style here seems inconsistent (PascalCase vs camelCase), what is the motivation for that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sorry, it should use PascalCase, i have modified it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: {} initialize

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@gengleilei gengleilei force-pushed the feature-refactor-filter-ex branch from f826741 to 2ac8278 Compare April 11, 2019 05:53
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ref link to the document?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, thank you for reminding me.

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>
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>
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>
@gengleilei gengleilei force-pushed the feature-refactor-filter-ex branch from 21f5439 to a5633b8 Compare April 12, 2019 01:47
@gengleilei
Copy link
Copy Markdown
Contributor Author

@lizan Is there any other code review opinion ?

@lizan lizan merged commit db7f124 into envoyproxy:master Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants