Skip to content

Optimize: remove deplicate judge available #2908

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

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

marsevilspirit
Copy link
Member

The logic for determining whether the invoker is available is repeated.

}

if !di.BaseInvoker.IsAvailable() {
// Generally, the case will not happen, because the invoker has been removed
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain why you want to delete it? If you delete it, will there be a certain risk of causing race conditions in high concurrency scenarios? I hope to get an answer

Copy link
Member Author

Choose a reason for hiding this comment

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

You need to take a look at the complete Invoke method of dubbo Invoker. This function checks available twice, and the Invoke function is called very frequently, so it shouldn't spend extra time checking twice. The triple invoker only checks once, and the dubbo invoker should be synchronized with the triple invoker.

@marsevilspirit marsevilspirit force-pushed the remove-deplicate-judge-available branch from e72d0ea to 31d31fa Compare June 6, 2025 08:53
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants