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

GH-41347: [FlightRPC][C#] Allow hosting flight server in pre-Kestrel .net versions #41348

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

qed-
Copy link
Contributor

@qed- qed- commented Apr 23, 2024

Rationale for this change

With the existing structure it is not possible to create a flight RPC service as a regular GRPC service, outside of AspNet.Core/Kestrel.

This can be supported by changing the protection level of the generated classes and FlightServiceImplementation.cs

What changes are included in this PR?

Change protection level from internal to public for generated protocol files and FlightServiceImplementation.cs

Are these changes tested?

Confirmed that classes are public in the built assembly.

Are there any user-facing changes?

Generated protocol classes will become visible to end users.

Copy link

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

Copy link
Contributor

@CurtHagenlocher CurtHagenlocher left a comment

Choose a reason for hiding this comment

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

It's a bit unfortunate that we have to expose so many internals to make this work; it creates "upgrade risk" for anyone who happens to take a dependency on the generated classes. Out of curiosity, what's the server or servers you're interested in? Are they likely of wider interest? Could we ship that support as a separate project from this codebase?

Otherwise, I think FlightServerImplementation should be moved to the "Server" namespace and directory as it's clearly no longer "Internal".

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Apr 23, 2024
@qed-
Copy link
Contributor Author

qed- commented Apr 25, 2024

Thanks for your comments. My use case is to run a Flight GRPC server on .Net framework (due to it depending on legacy assemblies that don't work with .net core).

I've modified the PR to move the namespace as you suggested.

The other option would be to create a public class that implements code similar to the below, happy to do it this way if you think this is a better option.

using Apache.Arrow.Flight.Protocol;
using Apache.Arrow.Flight.Server;

var flightServer = new FlightServerImpl();
var server = new Server
{
    Services = {  FlightService.BindService(new FlightServerImplementation(flightServer)) },
    Ports =  { new ServerPort("0.0.0.0", 5001, ServerCredentials.Insecure) }   }
};
server.Start();

@qed-
Copy link
Contributor Author

qed- commented May 10, 2024

Hi @CurtHagenlocher, please let me know if you'd like further changes to this PR.

@qed- qed- changed the title GH-41347: [FlightRPC][C#] Change protection levels of classes to support non-Kestreal GRPC flight server GH-41347: [FlightRPC][C#] Change protection levels of classes to support non-Kestrel GRPC flight server May 15, 2024
@qed-
Copy link
Contributor Author

qed- commented Jun 17, 2024

hi @CurtHagenlocher - any feedback on this? Thanks.

@CurtHagenlocher
Copy link
Contributor

I'm very sorry for the delay, @qed; I'd meant to take another look at this before the fork for the next release, but we've now run out of time. Can you say a little more about the other option? What class exactly is "Server" here?

@qed-
Copy link
Contributor Author

qed- commented Jul 1, 2024

Hi @CurtHagenlocher, no worries.

Server is this class https://grpc.github.io/grpc/csharp/api/Grpc.Core.Server.html

We are using this to run the server on HTTP.sys, due to Kestrel not being available in .Net framework.

@CurtHagenlocher
Copy link
Contributor

Okay, thanks! What if we were to have a separate build target which references Desktop framework and contains a package reference to that older gRPC framework and the code you need to be able to use it? That way, the newer package doesn't pick up a conflicting and unneeded dependency.

@qed-
Copy link
Contributor Author

qed- commented Jul 2, 2024

Yes I'd be happy with that approach.

@qed- qed- changed the title GH-41347: [FlightRPC][C#] Change protection levels of classes to support non-Kestrel GRPC flight server GH-41347: [FlightRPC][C#] Allow hosting flight server in pre-Kestrel .net versions Jul 11, 2024
@qed-
Copy link
Contributor Author

qed- commented Jul 11, 2024

@CurtHagenlocher changed as suggested, let me know if you'd like any further changes.

@CurtHagenlocher CurtHagenlocher merged commit cf010cd into apache:main Sep 14, 2024
9 of 10 checks passed
@CurtHagenlocher CurtHagenlocher removed the awaiting committer review Awaiting committer review label Sep 14, 2024
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit cf010cd.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 31 possible false positives for unstable benchmarks that are known to sometimes produce them.

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.

2 participants