Repository navigation
sipproxy: enhance routing handler and async framework - #19951
Conversation
|
Please fix DCO issue. |
commit a282c84c374ac64fefc607d0ad9e034c65040c6d Author: Felix Du <[email protected]> Date: Tue Feb 15 18:36:48 2022 +0800 update Signed-off-by: Felix Du <[email protected]> commit 62df1620bbf899a7d5b6874ac3325181e04e7957 Author: Felix Du <[email protected]> Date: Tue Feb 15 16:15:11 2022 +0800 update Signed-off-by: Felix Du <[email protected]> commit de51141593bde17f5716cc067897303db6c88efb Author: Felix Du <[email protected]> Date: Tue Feb 15 16:10:59 2022 +0800 fix code format Signed-off-by: Felix Du <[email protected]> commit 4ffa478cffce272a0732d60b23b16ae188f17f2b Merge: 856b8cf8d3 4077a2cbc1 Author: Felix Du <[email protected]> Date: Tue Feb 15 15:17:30 2022 +0800 Merge branch 'sipproxy-v3' of github.com:durd07/envoy into sipproxy-v3 Signed-off-by: Felix Du <[email protected]> commit 856b8cf8d33d550cd325da65bdbc4e5f082fcbe0 Author: Felix Du <[email protected]> Date: Tue Feb 15 15:17:06 2022 +0800 revert it Signed-off-by: Felix Du <[email protected]> commit 6f872f8b0141e9b37dea76a858f0ecb4858de580 Author: Felix Du <[email protected]> Date: Tue Feb 15 15:13:55 2022 +0800 Revert "add contrib build" This reverts commit 7e54382. Signed-off-by: Felix Du <[email protected]> commit 4077a2cbc15aa6895ac20208f56ecfebd2fb0974 Merge: ec89e3c13e 97df15c156 Author: Mingling Ding <[email protected]> Date: Tue Feb 15 13:36:37 2022 +0800 Merge branch 'sipproxy-v3' of github.com:durd07/envoy into sipproxy-v3 commit ec89e3c13e54b06fafedf44dbcb7433a6feb6b2b Author: Mingling Ding <[email protected]> Date: Tue Feb 15 13:36:07 2022 +0800 update ut commit 97df15c1569902ed1cc0c315305eac5b501cd5ed Merge: f226d60cc3 e727e1f Author: Felix Du <[email protected]> Date: Tue Feb 15 13:24:49 2022 +0800 Merge branch 'envoyproxy:main' into sipproxy-v3 commit f226d60cc37400146d6f075fdcd356ba089ccd6b Merge: ee69bf5cf2 1ed20ca12d Author: Mingling Ding <[email protected]> Date: Tue Feb 15 11:00:38 2022 +0800 Merge branch 'sipproxy-v3' of github.com:durd07/envoy into sipproxy-v3 commit ee69bf5cf2d01ccee348c6be2ff11173f5a80995 Author: Mingling Ding <[email protected]> Date: Tue Feb 15 11:00:08 2022 +0800 update UT commit 1ed20ca12d5450f9ec816a9fec575b84134d0561 Merge: 75d50d7f3c 51b6a83 Author: Felix Du <[email protected]> Date: Fri Feb 11 13:00:56 2022 +0800 Merge remote-tracking branch 'origin/main' into sipproxy-v3 Signed-off-by: Felix Du <[email protected]> commit 75d50d7f3cbaf9ccf7fd3e7738fdffc6c8967b28 Merge: 997118649b c9b50fe Author: Felix Du <[email protected]> Date: Wed Feb 9 09:26:36 2022 +0800 Merge remote-tracking branch 'origin/main' into sipproxy-v3 Signed-off-by: Felix Du <[email protected]> commit 997118649b394c6a63de56c2423d8b52b24feff3 Author: Mingling Ding <[email protected]> Date: Fri Jan 28 14:28:49 2022 +0800 update reason header commit 68338365a0a74a8834ff8a8773c206dfee66ea5a Merge: 3296cb3ea4 803f21f68b Author: Felix Du <[email protected]> Date: Fri Jan 28 11:20:17 2022 +0800 Merge branch 'sipproxy-v3' of github.com:durd07/envoy into sipproxy-v3 Signed-off-by: Felix Du <[email protected]> commit 803f21f68b97f606d239ec03ffa4d32f0ad346c4 Author: Mingling Ding <[email protected]> Date: Fri Jan 28 11:04:57 2022 +0800 update commit 3296cb3ea4cd39892b04cc65fa03391fdde17ebb Merge: cef8a4a270 1580d7c Author: Felix Du <[email protected]> Date: Fri Jan 28 02:15:43 2022 +0000 Merge remote-tracking branch 'origin/main' into sipproxy-v3 Signed-off-by: Felix Du <[email protected]> commit cef8a4a2708547b474860b30bff2597e64eab170 Author: root <[email protected]> Date: Tue Jan 25 13:05:07 2022 +0800 fix bug Signed-off-by: root <[email protected]> commit 60e55673ccdcf175dd111db1b1d685edd93c20e6 Author: Felix Du <[email protected]> Date: Mon Jan 24 21:37:56 2022 +0800 update Signed-off-by: Felix Du <[email protected]> commit 2d5c76b35aeb42d7037c9c423c47bd07c229f39e Author: Felix Du <[email protected]> Date: Mon Jan 24 14:24:12 2022 +0800 fix it Signed-off-by: Felix Du <[email protected]> commit be7ed7b93e0df43f20b6709f4551a297876d9a78 Author: Felix Du <[email protected]> Date: Mon Jan 24 14:11:48 2022 +0800 fix them Signed-off-by: Felix Du <[email protected]> commit eae0b7a10df130ff31ee7251a1316e68ed884ebf Merge: fd98e4f6ca 5b09f69 Author: Felix Du <[email protected]> Date: Fri Jan 21 13:46:59 2022 +0800 Merge remote-tracking branch 'origin/sipproxy-v2' into sipproxy-v3 Signed-off-by: Felix Du <[email protected]> commit fd98e4f6cad0dad96bc89d57e37f3e101435369b Merge: 8c8523c2e4 c171c69 Author: Felix Du <[email protected]> Date: Fri Jan 21 10:51:32 2022 +0800 Merge branch 'async' of github.com:durd07/envoy into async Signed-off-by: Felix Du <[email protected]> commit 5b09f69 Author: MINGLING <MINGLING> Date: Fri Jan 21 10:28:49 2022 +0800 update route/affinity commit c171c69 Author: Felix Du <[email protected]> Date: Thu Jan 20 18:20:04 2022 +0800 fix commit 80f361b Author: Felix Du <[email protected]> Date: Thu Jan 20 09:57:17 2022 +0000 async code commit 7e54382 Author: Felix Du <[email protected]> Date: Wed Jan 19 16:47:24 2022 +0800 add contrib build commit 1439229 Author: Felix Du <[email protected]> Date: Wed Jan 19 15:43:42 2022 +0800 delete sip proxy integrate_test commit 8c8523c2e4d6341b4a9a223a0614aef25614bd5c Merge: 6aab794442 db516c8 Author: Felix Du <[email protected]> Date: Wed Jan 19 13:50:49 2022 +0800 Merge branch 'async' of github.com:durd07/envoy into async Signed-off-by: Felix Du <[email protected]> commit db516c8 Author: Felix Du <[email protected]> Date: Tue Jan 18 11:25:56 2022 +0800 fix compile error commit d5e9b37 Author: Felix Du <[email protected]> Date: Tue Jan 18 11:25:08 2022 +0800 add build steps commit 0cfd6d5 Author: Felix Du <[email protected]> Date: Tue Jan 18 09:56:13 2022 +0800 redir commit c2cbdb6 Author: Felix Du <[email protected]> Date: Mon Jan 17 18:37:08 2022 +0800 add keyword Wait For Socket Listened commit 9e8dc64 Author: Felix Du <[email protected]> Date: Mon Jan 17 18:19:49 2022 +0800 add tra commit 80f0acc Author: Felix Du <[email protected]> Date: Mon Jan 17 16:37:43 2022 +0800 update commit 19c3cfe Author: Felix Du <[email protected]> Date: Mon Jan 17 16:07:06 2022 +0800 add sip integrate test commit 73190e0 Merge: 3b257ac 20ae148 Author: Felix Du <[email protected]> Date: Mon Jan 17 09:51:00 2022 +0800 Merge remote-tracking branch 'origin/main' into async Signed-off-by: Felix Du <[email protected]> commit 3b257ac Author: Felix Du <[email protected]> Date: Fri Jan 14 20:18:14 2022 +0800 async compile error Signed-off-by: Felix Du <[email protected]> commit caa3140 Author: Mingling Ding <[email protected]> Date: Wed Jan 12 13:26:10 2022 +0800 update 503 commit 24a59b0 Author: Felix Du <[email protected]> Date: Tue Jan 11 17:24:05 2022 +0800 reason commit 4804266 Merge: 1aafbb8 28e1da9 Author: Felix Du <[email protected]> Date: Tue Jan 11 11:16:39 2022 +0800 Merge remote-tracking branch 'origin/sipproxy-v2' into async Signed-off-by: Felix Du <[email protected]> commit 1aafbb8 Author: Felix Du <[email protected]> Date: Tue Jan 11 11:13:26 2022 +0800 save Signed-off-by: Felix Du <[email protected]> commit 28e1da9 Author: Felix Du <[email protected]> Date: Tue Jan 11 10:42:36 2022 +0800 update affinity commit 295385d Merge: 05c5172 5c493d5 Author: Felix Du <[email protected]> Date: Mon Jan 10 14:41:33 2022 +0800 Merge remote-tracking branch 'origin/sipproxy-v2' into async Signed-off-by: Felix Du <[email protected]> commit 05c5172 Author: Felix Du <[email protected]> Date: Mon Jan 10 14:31:40 2022 +0800 async temp save Signed-off-by: Felix Du <[email protected]> commit 5c493d5 Author: Felix Du <[email protected]> Date: Mon Jan 10 14:00:37 2022 +0800 update affinity commit 940ef57 Author: Felix Du <[email protected]> Date: Thu Jan 6 10:56:38 2022 +0800 continue handling commit 7a7b2e2 Author: Felix Du <[email protected]> Date: Wed Jan 5 17:06:55 2022 +0800 503 message commit 6aab794442765a4afbe88c2f0ea9078d8bab3f32 Merge: 931e562 e9f36d2 Author: Felix Du <[email protected]> Date: Tue Jan 4 13:59:31 2022 +0800 Merge remote-tracking branch 'origin/main' into async Signed-off-by: Felix Du <[email protected]> commit 6bd3572 Author: Felix Du <[email protected]> Date: Tue Jan 4 10:54:00 2022 +0800 503 message commit 8b185e4 Merge: e9f36d2 931e562 Author: Felix Du <[email protected]> Date: Tue Jan 4 10:43:37 2022 +0800 Merge remote-tracking branch 'origin/sipproxy-v1' into sipproxy-v2 commit 931e562 Author: Mingling Ding <[email protected]> Date: Mon Dec 13 14:52:33 2021 +0800 fix presubmit error Signed-off-by: Mingling Ding <[email protected]> commit c502e5e Author: Mingling Ding <[email protected]> Date: Mon Dec 13 13:14:12 2021 +0800 fix format Signed-off-by: Mingling Ding <[email protected]> commit f161ba8 Author: Felix Du <[email protected]> Date: Mon Dec 13 12:41:55 2021 +0800 update Signed-off-by: Mingling Ding <[email protected]> commit 420a480 Author: Felix Du <[email protected]> Date: Mon Dec 13 11:28:05 2021 +0800 update Signed-off-by: Felix Du <[email protected]> commit 3162df4 Author: Felix Du <[email protected]> Date: Mon Dec 13 11:14:21 2021 +0800 update Signed-off-by: Felix Du <[email protected]> commit 2718523 Author: Mingling <[email protected]> Date: Mon Dec 13 10:14:26 2021 +0800 update Signed-off-by: Mingling <[email protected]> commit 675f468 Author: Mingling <[email protected]> Date: Fri Dec 10 14:59:41 2021 +0800 push error Signed-off-by: Mingling <[email protected]> commit c9c9fd4 Author: Mingling <[email protected]> Date: Fri Dec 10 14:25:05 2021 +0800 routing affinity Signed-off-by: Mingling <[email protected]> Signed-off-by: Felix Du <[email protected]>
Signed-off-by: Felix Du <[email protected]>
Signed-off-by: Felix Du <[email protected]>
|
/assign-from @envoyproxy/first-pass-reviewers |
|
@envoyproxy/first-pass-reviewers assignee is @rojkov |
Signed-off-by: Felix Du <[email protected]>
Signed-off-by: Felix Du <[email protected]>
|
Hi @daixiang0 @rojkov, Please help to review this, all checks have passed. Thanks in advance. |
rojkov
left a comment
There was a problem hiding this comment.
Thanks for working on this! I added a few comments, but the PR is huge and seems to contain many enhancements. Would it be possible to split it into multiple PRs?
| string domain = 1; | ||
| } | ||
|
|
||
| // The header to get match parameter, default is route. |
There was a problem hiding this comment.
Is route a string value? If so better enclose it in quotes.
There was a problem hiding this comment.
Thanks for your comments, it is addressed.
// The header to get match parameter, default is "Route".
| // Affinity rules to conclude the upstream endpoint | ||
| repeated CustomizedAffinityEntry entries = 1; | ||
|
|
||
| // After affinity handling, whether load balance should be stop or continue |
There was a problem hiding this comment.
| // After affinity handling, whether load balance should be stop or continue | |
| // Configures whether load balance should be stopped or continued after affinity handling. |
There was a problem hiding this comment.
Thanks for your advise. follow it.
| output += "To: "; | ||
| auto to = absl::get<VectorHeader>(metadata.msgHeaderList()[HeaderType::To])[0]; | ||
| output += std::string(to); |
There was a problem hiding this comment.
Would it be easier to use Abseil's string formatting functions or fmt::format here?
| CustomizedAffinity aff(affinity.key_name(), affinity.query(), affinity.subscribe()); | ||
| customized_affinity_list_.emplace_back(aff); | ||
| } | ||
| customized_affinity_ = config.customized_affinity(); |
There was a problem hiding this comment.
This should go to ctor's init list.
There was a problem hiding this comment.
Right, thanks for your comments.
| virtual envoy::extensions::filters::network::sip_proxy::v3alpha::CustomizedAffinity | ||
| customizedAffinity() const PURE; |
There was a problem hiding this comment.
Is this method used anywhere? If so could it be amended to return const ref to avoid copies of envoy::extensions::filters::network::sip_proxy::v3alpha::CustomizedAffinity?
There was a problem hiding this comment.
Yes, changed it into const reference. Thanks for your comments.
Signed-off-by: Felix Du <[email protected]>
Signed-off-by: Felix Du <[email protected]>
Signed-off-by: Felix Du <[email protected]>
|
/retest |
|
Retrying Azure Pipelines: |
Signed-off-by: Felix Du <[email protected]>
Signed-off-by: Felix Du <[email protected]>
Signed-off-by: Felix Du <[email protected]>
Hi @rojkov Thanks for your valuable comments. all of your commens has been addressed. Could you please take a look? |
|
I see. Reviewing such gigantic PRs with over a thousand LOC requires allocating significant time slots. I'm afraid my employer wouldn't be eager to allow me that. Delays seem to be inevitable. :( You could start with elaborating the description of what exactly this PR does. Perhaps there is a way to move some logical part (e.g. related to "503 Error Response") to a separate PR? |
Signed-off-by: Felix Du <[email protected]>
|
/retest |
|
Retrying Azure Pipelines: |
|
Hi @rojkov , could you please continue to review this PR? all test are passed and this is one contrib extension. |
|
@rojkov FYI for contrib you can mostly just skim and then merge. We don't do quality reviews for contrib extensions. |
rojkov
left a comment
There was a problem hiding this comment.
Ok, good! I've skimmed the change and added some suggestions. They are nitpicks mostly.
| // The header to get match parameter, default is "Route". | ||
| string header = 2; | ||
|
|
||
| // The parameter to get domain, default is host. |
There was a problem hiding this comment.
| // The parameter to get domain, default is host. | |
| // The parameter to get domain, default is "Host". |
| external_deps = ["abseil_optional"], | ||
| deps = [ | ||
| ":sip_lib", | ||
| # ":decoder_lib", |
|
|
||
| // TODO | ||
| // Top line | ||
| output += "SIP/2.0 503 Service Unavaliable\r\n"; |
| // To | ||
| if (!absl::get<VectorHeader>(metadata.msgHeaderList()[HeaderType::To]).empty()) { | ||
| auto to = absl::get<VectorHeader>(metadata.msgHeaderList()[HeaderType::To])[0]; | ||
| output += fmt::format("{}: {}", "To", to); |
There was a problem hiding this comment.
| output += fmt::format("{}: {}", "To", to); | |
| output += fmt::format("To: {}", to); |
| t = time(&t); | ||
| s = std::labs(t - s); | ||
| sprintf(buf, "%lx", s); | ||
| output += buf; |
There was a problem hiding this comment.
Nitpick: can't we just use output += fmt::format("{}", s);? Also std::stringstream could be more appropriate instead of the string concatenations in encode().
| t = value.substr(0, value.find_first_of(": ")); | ||
| v = value.substr(value.find_first_of(": ") + strlen(": "), | ||
| value.length() - t.length() - strlen(": ")); | ||
| // ENVOY_LOG(error, "t:{}, v:{}", t, v); |
| } | ||
| } | ||
| auto domain = metadata.getDomainFromHeaderParameter(header, parameter_); | ||
| // if (domain_ == metadata.getDomainFromHeaderParameter(header, parameter_)) { |
| true); | ||
| std::cout << "DDD ---------------1\n"; | ||
| throw AppException(AppExceptionType::UnknownMethod, "envoy no match route found"); | ||
| return FilterStatus::StopIteration; |
There was a problem hiding this comment.
This line doesn't seem to be reachable now. Can be dropped.
| true); | ||
| throw AppException(AppExceptionType::InternalError, | ||
| fmt::format("unknown cluster '{}'", cluster_name)); | ||
| return FilterStatus::StopIteration; |
| true); | ||
| throw AppException(AppExceptionType::InternalError, | ||
| fmt::format("maintenance mode for cluster '{}'", cluster_name)); | ||
| return FilterStatus::StopIteration; |
|
/wait |
Signed-off-by: Felix Du <[email protected]>
|
Hi @rojkov Thanks for your valuable comments. all of your commens has been addressed. Please help to review again. |
|
Does this change modify any behavior visible to users? Basically, would it make sense to add a release note to |
Signed-off-by: Felix Du <[email protected]>
Signed-off-by: Felix Du <[email protected]>
Signed-off-by: Felix Du <[email protected]>
|
the release note updated. Thanks for your advise! |
Signed-off-by: Felix Du <[email protected]>
Signed-off-by: Felix Du <[email protected]>
Signed-off-by: Felix Du <[email protected]>
rojkov
left a comment
There was a problem hiding this comment.
Thank you for your contribution! LGTM
rojkov
left a comment
There was a problem hiding this comment.
Oops, sorry. I was too quick. Could you please reword the notes to make them clearer a bit as suggested?
Co-authored-by: Dmitry Rozhkov <[email protected]> Signed-off-by: Felix Du <[email protected]>
Co-authored-by: Dmitry Rozhkov <[email protected]> Signed-off-by: Felix Du <[email protected]>
Commit Message: sipproxy: enhance routing handler and async framework
Additional Description:
Risk Level: Low
Testing: Ut/Mt
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]