{"record":{"id":"2e397615484c2f4d","repo":"apache/beam","slug":"interrupted-while-fetching-flight-schema","errorCode":null,"errorMessage":"Interrupted while fetching Flight schema","messagePattern":"Interrupted while fetching Flight schema","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/arrow-flight/src/main/java/org/apache/beam/sdk/io/arrowflight/ArrowFlightIO.java","lineNumber":289,"sourceCode":"\n    @Override\n    public PCollection<Row> expand(PBegin input) {\n      checkArgument(host() != null, \"withHost() is required\");\n      checkArgument(command() != null, \"withCommand() is required\");\n\n      Schema beamSchema;\n      try (BufferAllocator allocator = new RootAllocator(Long.MAX_VALUE);\n          FlightClient client =\n              createClient(allocator, checkNotNull(host(), \"host\"), port(), useTls())) {\n        FlightInfo info =\n            client.getInfo(\n                FlightDescriptor.command(\n                    checkNotNull(command(), \"command\").getBytes(StandardCharsets.UTF_8)),\n                callOptions());\n        beamSchema = ArrowConversion.ArrowSchemaTranslator.toBeamSchema(info.getSchema());\n      } catch (InterruptedException e) {\n        Thread.currentThread().interrupt();\n        throw new RuntimeException(\"Interrupted while fetching Flight schema\", e);\n      }\n\n      return input\n          .apply(org.apache.beam.sdk.io.Read.from(new FlightBoundedSource(this, beamSchema)))\n          .setRowSchema(beamSchema);\n    }\n\n    CallOption[] callOptions() {\n      return ArrowFlightIO.callOptions(token());\n    }\n\n    @Override\n    public void populateDisplayData(DisplayData.Builder builder) {\n      super.populateDisplayData(builder);\n      builder.addIfNotNull(DisplayData.item(\"host\", host()));\n      builder.add(DisplayData.item(\"port\", port()));\n      builder.add(DisplayData.item(\"useTls\", useTls()));\n      builder.addIfNotNull(DisplayData.item(\"command\", command()));","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/arrow-flight/src/main/java/org/apache/beam/sdk/io/arrowflight/ArrowFlightIO.java#L271-L307","documentation":"In ArrowFlightIO.Read.expand, fetching the FlightInfo (schema) from the Flight service was interrupted while blocking on the RPC; the code restores the interrupt flag and throws RuntimeException('Interrupted while fetching Flight schema'). The read cannot proceed without the schema.","triggerScenarios":"The thread executing expand is interrupted while calling flightClient.getInfo(FlightDescriptor) — e.g., pipeline cancellation or shutdown during pipeline construction.","commonSituations":"User cancels the pipeline during startup, runner kills the submitting thread, overly aggressive timeouts during job setup.","solutions":["Rerun the pipeline — interruption during startup is usually transient.","Check for cancellation requests in the runner logs around the failure.","Verify the Flight server responds promptly; a hung getInfo can prompt timeouts/interruption.","Avoid interrupting/terminating the driver process while the graph is being built."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// probe Flight server responsiveness before launching\nflightClient.getInfo(FlightDescriptor.path(\"probe\"));","typeGuard":null,"tryCatchPattern":"try {\n  result = pipeline.run().waitUntilFinish();\n} catch (RuntimeException e) {\n  if (e.getCause() instanceof InterruptedException) {\n    // restart the pipeline; startup interruption is transient\n  }\n}","preventionTips":["Don't cancel the pipeline during graph construction/startup","Ensure the Flight server responds quickly to getInfo","Avoid aggressive driver-side timeouts during job setup","Check runner logs for external cancellation triggers"],"tags":["arrow-flight","interrupted","schema","rpc"],"backgroundTag":"thread-interrupted","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}