Skip to content

Conversation

@kou
Copy link
Member

@kou kou commented May 1, 2023

Rationale for this change

Because they are also RPC calls to like others such as ListFlights() and DoGet().

What changes are included in this PR?

Add with ServerCallContext versions.

Old signature versions still exist for keeping backward compatibility.

Are these changes tested?

Yes.

Are there any user-facing changes?

Yes.

This PR includes breaking changes to public APIs.

@kou kou requested a review from lidavidm as a code owner May 1, 2023 07:18
@github-actions
Copy link

github-actions bot commented May 1, 2023

@github-actions
Copy link

github-actions bot commented May 1, 2023

⚠️ GitHub issue #35377 has been automatically assigned in GitHub to PR creator.

…to `arrow::flight::ServerAuthHandler` methods

Because they are also RPC calls to like other `ListFlights()`,
`DoGet()` and so on.
@kou kou force-pushed the cpp-flight-server-auth-handler-call-context branch from 48b71e7 to b8bfd16 Compare May 1, 2023 07:22
Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

LGTM.

Comment on lines 61 to 68
/// If this version is implemented, the deprecated Authentication()
/// without ServerCallContext version isn't used. So we can
/// implement the deprecated version like the following:
///
/// Status Authenticate(ServerAuthSender* outgoing,
/// ServerAuthReader* incoming) override {
/// return Status::NotImplemented("This version is never used");
/// }
Copy link
Member

Choose a reason for hiding this comment

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

We could change the deprecated overload from pure virtual to just virtual, and add a default no-op/always-failing implementation. That way people who only implement the new overload won't have to update code when we remove the deprecated overload. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, it's a good idea! I'll do it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

/// \return Status OK if this authentication is succeeded.
/// \deprecated Deprecated since 13.0.0. Implement the Authentication()
/// with ServerCallContext version instead.
virtual Status Authenticate(ServerAuthSender* outgoing, ServerAuthReader* incoming) = 0;
Copy link
Member

Choose a reason for hiding this comment

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

I suppose we can't mark this as deprecated to the compiler without triggering a bunch of warnings on ourselves, can we...

Copy link
Member Author

Choose a reason for hiding this comment

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

We can mark this as deprecated but client codes that overrides this don't receive any deprecated warning from their compiler. Because client codes don't call this method. Our server implementations call this method instead.

Anyway, I've added ARROW_DEPRECATED() because a -Wdocumentation-deprecated-sync warning is reported without it: https://github.com/kou/arrow/actions/runs/4849400904/jobs/8641350382#step:9:1437

/Users/runner/work/arrow/arrow/cpp/src/arrow/flight/server_auth.h:83:8: error: declaration is marked with '\deprecated' command but does not have a deprecation attribute [-Werror,-Wdocumentation-deprecated-sync]
  /// \deprecated Deprecated since 13.0.0. Implement the Authentication()
      ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/runner/work/arrow/arrow/cpp/src/arrow/flight/server_auth.h:85:3: note: add a deprecation attribute to the declaration to silence this warning
  virtual Status Authenticate(ServerAuthSender* outgoing, ServerAuthReader* incoming) = 0;
  ^

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels May 1, 2023
@github-actions github-actions bot added awaiting change review Awaiting change review awaiting changes Awaiting changes and removed awaiting changes Awaiting changes awaiting change review Awaiting change review labels May 1, 2023
/// authentication method supports it.
/// \return Status OK if the token is valid, any other status if
/// validation failed
virtual Status IsValid(const ServerCallContext& context, const std::string& token,
Copy link
Member

Choose a reason for hiding this comment

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

Looks like doxygen complains unless there's a \param for this

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch!
I forgot to add it...

@github-actions github-actions bot added Component: GLib awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels May 2, 2023
@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels May 2, 2023
@kou kou merged commit 42527e1 into apache:main May 2, 2023
@kou kou deleted the cpp-flight-server-auth-handler-call-context branch May 2, 2023 03:12
@ursabot
Copy link

ursabot commented May 2, 2023

Benchmark runs are scheduled for baseline = be12888 and contender = 42527e1. 42527e1 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed ⬇️1.66% ⬆️0.06%] test-mac-arm
[Failed ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.93% ⬆️0.12%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] 42527e15 ec2-t3-xlarge-us-east-2
[Failed] 42527e15 test-mac-arm
[Failed] 42527e15 ursa-i9-9960x
[Finished] 42527e15 ursa-thinkcentre-m75q
[Finished] be128889 ec2-t3-xlarge-us-east-2
[Failed] be128889 test-mac-arm
[Failed] be128889 ursa-i9-9960x
[Finished] be128889 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot
Copy link

ursabot commented May 2, 2023

['Python', 'R'] benchmarks have high level of regressions.
test-mac-arm

liujiacheng777 pushed a commit to LoongArch-Python/arrow that referenced this pull request May 11, 2023
…to `arrow::flight::ServerAuthHandler` methods (apache#35378)

### Rationale for this change

Because they are also RPC calls to like others such as `ListFlights()` and `DoGet()`.

### What changes are included in this PR?

Add with `ServerCallContext` versions.

Old signature versions still exist for keeping backward compatibility.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.

**This PR includes breaking changes to public APIs.**

* C++ API: Don't include any breaking changes.
* C GLib API: Includes a breaking change. `context` argument is added.

* Closes: apache#35377

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
ArgusLi pushed a commit to Bit-Quill/arrow that referenced this pull request May 15, 2023
…to `arrow::flight::ServerAuthHandler` methods (apache#35378)

### Rationale for this change

Because they are also RPC calls to like others such as `ListFlights()` and `DoGet()`.

### What changes are included in this PR?

Add with `ServerCallContext` versions.

Old signature versions still exist for keeping backward compatibility.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.

**This PR includes breaking changes to public APIs.**

* C++ API: Don't include any breaking changes.
* C GLib API: Includes a breaking change. `context` argument is added.

* Closes: apache#35377

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++][FlightRPC] Add a ServerCallContext parameter to arrow::flight::ServerAuthHandler methods

3 participants