You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "tswstarplanet (GitHub)" <gi...@apache.org> on 2019/03/14 16:46:14 UTC

[GitHub] [incubator-dubbo] tswstarplanet opened issue #3662: RpcContext's ServerContext can not transform data from provider to consumer when using sync invoke mode

- [ ] I have searched the [issues](https://github.com/apache/incubator-dubbo/issues) of this repository and believe that this is not a duplicate.
- [ ] I have checked the [FAQ](https://github.com/apache/incubator-dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 2.7.x
* Operating System version: MacOS
* Java version: 1.8

### Steps to reproduce this issue

1. Execute following code in a method of a dubbo service on provider side:
```java
RpcContext.getServerContext().setAttachment("abc", "123");
```
2. Execute following code in the same thread that invoke the remote dubbo service after the invoking:
```java
Map<String, String> map = RpcContext.getServerContext().getAttachments();
System.out.println("context: " + map.get("abc"));
```

Pls. provide [GitHub address] to reproduce this issue.

### Expected Result

Console output:
context: 123

### Actual Result
context: null

What actually happens?

If there is an exception, please attach the exception trace:

```
Just put your stack trace here!
```


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


[GitHub] [incubator-dubbo] tswstarplanet commented on issue #3662: RpcContext's ServerContext can not transform data from provider to consumer when using sync invoke mode

Posted by "tswstarplanet (GitHub)" <gi...@apache.org>.
#3664 

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


[GitHub] [incubator-dubbo] tswstarplanet commented on issue #3662: RpcContext's ServerContext can not transform data from provider to consumer when using sync invoke mode

Posted by "tswstarplanet (GitHub)" <gi...@apache.org>.
ok, and the description of sync invoke can be migrated to that one

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


[GitHub] [incubator-dubbo] carryxyh commented on issue #3662: RpcContext's ServerContext can not transform data from provider to consumer when using sync invoke mode

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
But it will cause another problem.
Pls check my comment under your pr.

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


[GitHub] [incubator-dubbo] carryxyh commented on issue #3662: RpcContext's ServerContext can not transform data from provider to consumer when using sync invoke mode

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
hi, @tswstarplanet 
I'd like close this issue and pr.
Maybe we need more discuss with it.

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


[GitHub] [incubator-dubbo] tswstarplanet commented on issue #3662: RpcContext's ServerContext can not transform data from provider to consumer when using sync invoke mode

Posted by "tswstarplanet (GitHub)" <gi...@apache.org>.
I think it is two problems, one is sync invoke, the other is async. We can remains them both, or merge to one

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


[GitHub] [incubator-dubbo] tswstarplanet commented on issue #3662: RpcContext's ServerContext can not transform data from provider to consumer when using sync invoke mode

Posted by "tswstarplanet (GitHub)" <gi...@apache.org>.
Because this pr cannot solve the problem when using async invoke

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


[GitHub] [incubator-dubbo] tswstarplanet commented on issue #3662: RpcContext's ServerContext can not transform data from provider to consumer when using sync invoke mode

Posted by "tswstarplanet (GitHub)" <gi...@apache.org>.
I think the pr can be remained. It need some time to test ifit can solve the problem when using sync invoke without impacting async invoke. We donnot need to close one pr so quickly

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


[GitHub] [incubator-dubbo] carryxyh commented on issue #3662: RpcContext's ServerContext can not transform data from provider to consumer when using sync invoke mode

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
Maybe merge to one is better. We can change the title of https://github.com/apache/incubator-dubbo/issues/3620 to indicate there are some problems on server context. 

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


[GitHub] [incubator-dubbo] tswstarplanet commented on issue #3662: RpcContext's ServerContext can not transform data from provider to consumer when using sync invoke mode

Posted by "tswstarplanet (GitHub)" <gi...@apache.org>.
I am not sure if the remove operation of servercontext that is execute in the onResponse method is equal to be executed in the invoke method.

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


[GitHub] [incubator-dubbo] carryxyh commented on issue #3662: RpcContext's ServerContext can not transform data from provider to consumer when using sync invoke mode

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
of course not.... 
The two are not equal..

Since this pr can't fix the problem, I think we can close this issue and focus on https://github.com/apache/incubator-dubbo/issues/3620. What do u think

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


[GitHub] [incubator-dubbo] tswstarplanet commented on issue #3662: RpcContext's ServerContext can not transform data from provider to consumer when using sync invoke mode

Posted by "tswstarplanet (GitHub)" <gi...@apache.org>.
OK

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


[GitHub] [incubator-dubbo] carryxyh commented on issue #3662: RpcContext's ServerContext can not transform data from provider to consumer when using sync invoke mode

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
I think your pr will cause new problems. 
@chickenlj  Would you like to check this pr twice?

By the way, why create a new issue. Focus on https://github.com/apache/incubator-dubbo/issues/3620?

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