Skip to content
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

GrpcClient's grpcExecutor may be initialized multiple times #12055

Closed
PleaseGiveMeTheCoke opened this issue May 4, 2024 · 2 comments
Closed

Comments

@PleaseGiveMeTheCoke
Copy link

PleaseGiveMeTheCoke commented May 4, 2024

Describe the bug

  1. There is no double check lock of the createGrpcExecutor function in GrpcClient, so grpcExecutor may be initialized multiple times
  2. The createGrpcExecutor specifies a thread factory when creating the thread pool, and this thread factory will always use the ip of the server passed in by the createGrpcExecutor method as the thread name, even if the client later reconnects to a server with another ip.

Expected behavior
add a dcl lock to ensure grpcExecutor can be init only one time

Actually behavior
A clear and concise description of what you actually to happen.

How to Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See errors

Desktop (please complete the following information):

  • OS: [e.g. Centos]
  • Version [e.g. nacos-server 1.3.1, nacos-client 1.3.1]
  • Module [e.g. naming/config]
  • SDK [e.g. original, spring-cloud-alibaba-nacos, dubbo]

Additional context
Add any other context about the problem here.

@KomachiSion
Copy link
Collaborator

After briefly reviewing this portion of the code, I initially believe that the issue should not occur, because the createGrpcExecutor is only created during the initial connection attempt. In subsequent attempts, through the asynchronous reconnection thread, it requires triggering by reconnectContext. When starting the connection for the first time, there is no reconnectContext to trigger the reconnection thread, so only the thread that performs the start operation will create the Executor. Regardless of whether it is successful, and later, when the reconnection thread reconnects, the Executor would have already been created and is not null, thus it will not be created again.

@KomachiSion
Copy link
Collaborator

No more response from author, and current information means no this problem.

@KomachiSion KomachiSion closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants