Skip to content

[Bug] grpc adapter-Tracer.trace() can't success #289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CodingSinger opened this issue Dec 7, 2018 · 3 comments · Fixed by #291 or #995
Closed

[Bug] grpc adapter-Tracer.trace() can't success #289

CodingSinger opened this issue Dec 7, 2018 · 3 comments · Fixed by #291 or #995
Labels
area/integrations Issues or PRs related to integrations with open-source components good first issue Good for newcomers kind/bug Category issues or prs related to bug.
Milestone

Comments

@CodingSinger
Copy link
Contributor

Issue Description

Here is code url:
code
the interceptor's(Server or Client) interceptCall method and the Listener method may run on different Thread, So,Tracer.trace(throwable) may not success if current Thread don't have the Context. I think here is should use AsyncEntry and call

ContextUtil.runOnContext(finalEntry.getAsyncContext(), new Runnable() {
                                            @Override
                                            public void run() {
                                                Tracer.trace(new Exception());
                                            }
                                        });

Describe what happened (or what feature you want)

22

12

@CodingSinger
Copy link
Contributor Author

CodingSinger commented Dec 7, 2018

and i think shouldn't call method entry.exit() at the end of interceptCall?

@sczyh30 sczyh30 added the kind/bug Category issues or prs related to bug. label Dec 7, 2018
@sczyh30
Copy link
Member

sczyh30 commented Dec 7, 2018

Hi, thanks for reporting. This is the legacy code before Sentinel asynchronous entry support was introduced. So now we can refactor this to work correctly. Would you like to contribute a PR? :)

@CodingSinger
Copy link
Contributor Author

@sczyh30 ok,i'm pleased to do it. I'll give it a try

CodingSinger added a commit to CodingSinger/Sentinel that referenced this issue Dec 7, 2018
CodingSinger added a commit to CodingSinger/Sentinel that referenced this issue Dec 7, 2018
CodingSinger added a commit to CodingSinger/Sentinel that referenced this issue Dec 7, 2018
CodingSinger added a commit to CodingSinger/Sentinel that referenced this issue Dec 7, 2018
CodingSinger added a commit to CodingSinger/Sentinel that referenced this issue Dec 7, 2018
CodingSinger added a commit to CodingSinger/Sentinel that referenced this issue Dec 7, 2018
@sczyh30 sczyh30 added area/integrations Issues or PRs related to integrations with open-source components good first issue Good for newcomers labels Jul 16, 2019
@sczyh30 sczyh30 added this to the 1.7.0 milestone Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/integrations Issues or PRs related to integrations with open-source components good first issue Good for newcomers kind/bug Category issues or prs related to bug.
Projects
None yet
2 participants