Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-15908

[Python] FlightClient.DoAction raises RPC exception (C# Client <-> Python Flight Server)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • 7.0.0
    • None
    • C#, Python
    • Rider 2021.3
      Windows

      Server Packages/Versions:
      Python 3.10.2
      pyarrow 7.0.0

      Client Details:
      C# 9
      Grpc.Net.Client 2.42.0
      Apache.Arrow.Flight 7.0.0

    Description

      Hi all

      I'm busy testing arrow flight and I'm noticing that requesting actions from C# to Python is raising the following exception.

      Unhandled exception. System.AggregateException: One or more errors occurred. (Status(StatusCode="Unknown", Detail="a bytes-like object is required, not 'str'. Detail: Python exception: TypeError"))
       ---> Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="a bytes-like object is required, not 'str'. Detail: Python exception: TypeError")
         at Grpc.Net.Client.Internal.HttpContentClientStreamReader`2.MoveNextCore(CancellationToken cancellationToken)
         at Apache.Arrow.Flight.Internal.StreamReader`2.MoveNext(CancellationToken cancellationToken)
         --- End of inner exception stack trace ---
         at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
         at System.Threading.Tasks.Task.Wait()
         at Test.Program.Main(String[] args) in C:\Users\Chris\Test\Program.cs:line 33
       

      I've built a C# client and Python server which I've obtained from the Arrow Github repo.

      I've trimmed down the C# client to just the following code:

      using System;
      using Grpc.Net.Client;
      using Apache.Arrow.Flight.Client;
      using Apache.Arrow.Flight;
      
      namespace Test
      {
          class Program
          {
              static void Main(string[] args)
              {
                  var address = "http://localhost:5005";
                  Console.WriteLine($"Connecting to: {address}");
                  var channel = GrpcChannel.ForAddress(address);
                  var client = new FlightClient(channel);
                  var shutdownAction = client.DoAction(new FlightAction("shutdown"));                 shutdownAction.ResponseStream.MoveNext(default).Wait();
                  
              }
          }
      } 

       

      I've noted that the original code on the github repo example uses await (which no longer seems to work) and if I leave the final line out, the do_action() method is never called server-side.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ThatStatsGuy Chris Dunderdale
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: