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

Don't issue GetCapabilities calls if the requirement is NONE #20355

Closed
wants to merge 3 commits into from

Conversation

coeuvre
Copy link
Member

@coeuvre coeuvre commented Nov 29, 2023

Because the endpoint might not implement the GetCapabilities API, e.g. Remote Asset API.

Fixes #20342.

@coeuvre coeuvre marked this pull request as ready for review November 29, 2023 13:13
@coeuvre coeuvre requested a review from a team as a code owner November 29, 2023 13:13
@coeuvre coeuvre requested a review from tjgq November 29, 2023 13:13
@github-actions github-actions bot added team-Remote-Exec Issues and PRs for the Execution (Remote) team awaiting-review PR is awaiting review from an assigned reviewer labels Nov 29, 2023
Comment on lines +102 to +106
// Don't issue GetCapabilities calls if the requirement is NONE because the endpoint,
// e.g. Remote Asset API, might not implement the API. See #20342.
if (requirement == ServerCapabilitiesRequirement.NONE) {
return Single.just(
new ChannelConnectionWithServerCapabilities(channel, serverCapabilitiesSingle));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the logic reversed? This to me reads as "if the requirement is NONE, then call getAndVerifyServerCapabilities".

Copy link
Member Author

Choose a reason for hiding this comment

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

No. serverCapabilitiesSingle is a lazy evaluation of getAndVerifyServerCapabilities.

If the requirement is NONE, we store it and call getAndVerifyServerCapabilities only when ChannelConnectionWithServerCapabilities#getCapabilities is called.

Otherwise, we evaluate the single now which calls getAndVerifyServerCapabilities immediately.

@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Nov 30, 2023
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Nov 30, 2023
Because the endpoint might not implement the `GetCapabilities` API,  e.g. Remote Asset API.

Fixes bazelbuild#20342.

Closes bazelbuild#20355.

PiperOrigin-RevId: 586642258
Change-Id: If9ca3a1909729ea5d9410b7198bcacb5d67781aa
keertk pushed a commit that referenced this pull request Nov 30, 2023
…0.0 (#20382)

Because the endpoint might not implement the `GetCapabilities` API, e.g.
Remote Asset API.

Fixes #20342.

Closes #20355.

Commit
d7adb9a

PiperOrigin-RevId: 586642258
Change-Id: If9ca3a1909729ea5d9410b7198bcacb5d67781aa

Co-authored-by: Chi Wang <chiwang@google.com>
@coeuvre coeuvre deleted the fix-20342 branch December 11, 2023 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Remote-Exec Issues and PRs for the Execution (Remote) team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bazel calls GetCapabilities when using Remote Asset API in 7.0.0
2 participants