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

[FlightRPC][Java] FlightClients from FlightGrpcUtils#createFlightClient shutdown gRPC channel when closed

    XMLWordPrintableJSON

Details

    Description

      It seems there may be a mistake in the Java FlightClient where it's possible to create multiple FlightClients from a single ManagedChannel.

       

      See https://github.com/apache/arrow/blob/master/java/flight/flight-grpc/src/main/java/org/apache/arrow/flight/FlightGrpcUtils.java#L55 which lets you specify the channel. However, if you do create multiple FlightClients from a single channel, then calling close() (https://github.com/apache/arrow/blob/master/java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightClient.java#L503) on a single FlightClient will close the channel for all of the FlightClients that share that channel, which seems incorrect.

       

      It's possible that the FlightGrpcUtils was intended only for testing purposes and this should never happen in practice. A few possible options would be to:

      • This behaviour is intended, no action.
      • Track if a channel is used by multiple clients and only close on the last client to close.
      • Disallow creation of a FlightClient with a specified ManagedChannel.

      Attachments

        Issue Links

          Activity

            People

              kylep Kyle Porter
              kylep Kyle Porter
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m