Skip to content

core: document that NameResolver is not thread-safe. - #2918

Closed
zhangkun83 wants to merge 1 commit into
grpc:masterfrom
zhangkun83:nameresolver_nonthreadsafe
Closed

core: document that NameResolver is not thread-safe.#2918
zhangkun83 wants to merge 1 commit into
grpc:masterfrom
zhangkun83:nameresolver_nonthreadsafe

Conversation

@zhangkun83

Copy link
Copy Markdown
Contributor

Resolves #2649. This makes resolvers easier to implement.

Resolves grpc#2649.  This makes resolvers easier to implement.
}
savedListener = listener;
resolving = true;
// If this task is started by refresh(), there might already be a scheduled task.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if resolutionRunnable runs on a thread other than the original one it ran on. I don't know if ChannelExecutor is guaranteed to be serial.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, you are right. ChannelExecutor needs to be exposed to NameResolver so that tasks ran in an executor can be serialized with it. I will put this PR on hold until I have time to improve it.

@zhangkun83

Copy link
Copy Markdown
Contributor Author

Superseded by #5364

@zhangkun83 zhangkun83 closed this Feb 21, 2019
@zhangkun83
zhangkun83 deleted the nameresolver_nonthreadsafe branch February 21, 2019 23:40
@lock lock Bot locked as resolved and limited conversation to collaborators May 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NameResolver can be NotThreadSafe

2 participants