Skip to content

[Bug] The reportError(Throwable throwable) method and run() method in GRPCChannelManager cannot be re linked due to multithreading #9950

@Zhannan3

Description

@Zhannan3

Search before asking

  • I had searched in the issues and found no similar issues.

Apache SkyWalking Component

Java Agent (apache/skywalking-java)

What happened

If the run() methods Code in

notify(GRPCChannelStatus.CONNECTED);
reconnectCount = 0;
reconnect = false;

And reportError (Throwable Throwable) methods

if (isNetworkError(throwable)) {
reconnect = true;
notify(GRPCChannelStatus.DISCONNECT);
}

The code is run simultaneously, but in the order

notify(GRPCChannelStatus.CONNECTED);
reconnectCount = 0;
reconnect = true;
notify(GRPCChannelStatus.DISCONNECT);
reconnect = false;

Will appear
GRPCChannelStatus equals DISCONNECT
reconnect = false;
As a result, run() in GRPCChannelManager cannot establish a link again,Agent will no longer report information

What you expected to happen

GRPCChannelStatus equals DISCONNECT
reconnect = false;
As a result, run() in GRPCChannelManager cannot establish a link again,Agent will no longer report information

How to reproduce

run() method and reportError (Throwable Throwable) method run simultaneously

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working and you are sure it's a bug!choreChores about the project, like code cleaning up, typos, upgrading dependencies, etc.duplicateThis issue or pull request already existsjavaJava agent related

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions