You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "flycash (GitHub)" <gi...@apache.org> on 2020/01/20 12:44:18 UTC

[GitHub] [dubbo-go] flycash opened pull request #330: [WIP] Ftr: Context support

<!--  Thanks for sending a pull request! 
-->

**What this PR does**:

Adding context.Context to three methods: Filter.Invoke, Filter.OnResponse and Invoker.Invoke.

When we want to support some feature, like tracing and A/B test, we need to transfer the context between client and server. So we should refactor our interfaces to support the context argument.

**Which issue(s) this PR fixes**:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #

**Special notes for your reviewer**:

**Does this PR introduce a user-facing change?**:
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note

```

[ Full content available at: https://github.com/apache/dubbo-go/pull/330 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo-go] codecov-io commented on issue #330: Ftr: Context support

Posted by "codecov-io (GitHub)" <gi...@apache.org>.
# [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/330?src=pr&el=h1) Report
> Merging [#330](https://codecov.io/gh/apache/dubbo-go/pull/330?src=pr&el=desc) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/f8d1ecd6df67b14fdce27a45cf3e513fa1ac84c6?src=pr&el=desc) will **decrease** coverage by `0.58%`.
> The diff coverage is `73.23%`.

[![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/330/graphs/tree.svg?width=650&token=dcPE6RyFAL&height=150&src=pr)](https://codecov.io/gh/apache/dubbo-go/pull/330?src=pr&el=tree)

```diff
@@             Coverage Diff             @@
##           develop     #330      +/-   ##
===========================================
- Coverage    66.06%   65.48%   -0.59%     
===========================================
  Files          122      122              
  Lines         7562     7562              
===========================================
- Hits          4996     4952      -44     
- Misses        2074     2121      +47     
+ Partials       492      489       -3
```


| [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/330?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [registry/protocol/protocol.go](https://codecov.io/gh/apache/dubbo-go/pull/330/diff?src=pr&el=tree#diff-cmVnaXN0cnkvcHJvdG9jb2wvcHJvdG9jb2wuZ28=) | `81.73% <0%> (ø)` | :arrow_up: |
| [filter/filter\_impl/generic\_filter.go](https://codecov.io/gh/apache/dubbo-go/pull/330/diff?src=pr&el=tree#diff-ZmlsdGVyL2ZpbHRlcl9pbXBsL2dlbmVyaWNfZmlsdGVyLmdv) | `67.69% <0%> (ø)` | :arrow_up: |
| [protocol/invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/330/diff?src=pr&el=tree#diff-cHJvdG9jb2wvaW52b2tlci5nbw==) | `0% <0%> (ø)` | :arrow_up: |
| [common/proxy/proxy\_factory/default.go](https://codecov.io/gh/apache/dubbo-go/pull/330/diff?src=pr&el=tree#diff-Y29tbW9uL3Byb3h5L3Byb3h5X2ZhY3RvcnkvZGVmYXVsdC5nbw==) | `20.96% <0%> (ø)` | :arrow_up: |
| [...rotocol/protocolwrapper/protocol\_filter\_wrapper.go](https://codecov.io/gh/apache/dubbo-go/pull/330/diff?src=pr&el=tree#diff-cHJvdG9jb2wvcHJvdG9jb2x3cmFwcGVyL3Byb3RvY29sX2ZpbHRlcl93cmFwcGVyLmdv) | `51.42% <0%> (ø)` | :arrow_up: |
| [cluster/cluster\_impl/broadcast\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/330/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvYnJvYWRjYXN0X2NsdXN0ZXJfaW52b2tlci5nbw==) | `80% <100%> (ø)` | :arrow_up: |
| [cluster/cluster\_impl/available\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/330/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvYXZhaWxhYmxlX2NsdXN0ZXJfaW52b2tlci5nbw==) | `73.33% <100%> (ø)` | :arrow_up: |
| [cluster/cluster\_impl/failover\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/330/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvZmFpbG92ZXJfY2x1c3Rlcl9pbnZva2VyLmdv) | `72.34% <100%> (ø)` | :arrow_up: |
| [cluster/cluster\_impl/failfast\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/330/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvZmFpbGZhc3RfY2x1c3Rlcl9pbnZva2VyLmdv) | `71.42% <100%> (ø)` | :arrow_up: |
| [protocol/jsonrpc/jsonrpc\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/330/diff?src=pr&el=tree#diff-cHJvdG9jb2wvanNvbnJwYy9qc29ucnBjX2ludm9rZXIuZ28=) | `100% <100%> (ø)` | :arrow_up: |
| ... and [24 more](https://codecov.io/gh/apache/dubbo-go/pull/330/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/330?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/330?src=pr&el=footer). Last update [f8d1ecd...29c195d](https://codecov.io/gh/apache/dubbo-go/pull/330?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


[ Full content available at: https://github.com/apache/dubbo-go/pull/330 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [dubbo-go] zouyx commented on pull request #330: Ftr: Context support

Posted by "zouyx (GitHub)" <gi...@apache.org>.
split

[ Full content available at: https://github.com/apache/dubbo-go/pull/330 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo-go] flycash closed pull request #330: Ftr: Context support

Posted by "flycash (GitHub)" <gi...@apache.org>.
[ pull request closed by flycash ]

[ Full content available at: https://github.com/apache/dubbo-go/pull/330 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo-go] hxmhlt commented on pull request #330: Ftr: Context support

Posted by "hxmhlt (GitHub)" <gi...@apache.org>.
format

[ Full content available at: https://github.com/apache/dubbo-go/pull/330 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo-go] zouyx commented on pull request #330: Ftr: Context support

Posted by "zouyx (GitHub)" <gi...@apache.org>.
split

[ Full content available at: https://github.com/apache/dubbo-go/pull/330 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo-go] zouyx commented on pull request #330: Ftr: Context support

Posted by "zouyx (GitHub)" <gi...@apache.org>.
split

[ Full content available at: https://github.com/apache/dubbo-go/pull/330 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo-go] zouyx commented on pull request #330: Ftr: Context support

Posted by "zouyx (GitHub)" <gi...@apache.org>.
split

[ Full content available at: https://github.com/apache/dubbo-go/pull/330 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo-go] flycash commented on issue #330: Ftr: Context support

Posted by "flycash (GitHub)" <gi...@apache.org>.
Actually, I don't need to add UT because I just add a new parameter and make sure that there is not any compiling error.
I've changed the context.TODO() to context.Backgroud()

[ Full content available at: https://github.com/apache/dubbo-go/pull/330 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo-go] zouyx commented on pull request #330: Ftr: Context support

Posted by "zouyx (GitHub)" <gi...@apache.org>.
split

[ Full content available at: https://github.com/apache/dubbo-go/pull/330 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo-go] zouyx commented on pull request #330: Ftr: Context support

Posted by "zouyx (GitHub)" <gi...@apache.org>.
split

[ Full content available at: https://github.com/apache/dubbo-go/pull/330 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org