{"record":{"id":"29770b072b207de4","repo":"apache/beam","slug":"interrupted-while-discovering-flight-endpoints","errorCode":null,"errorMessage":"Interrupted while discovering Flight endpoints","messagePattern":"Interrupted while discovering Flight endpoints","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/arrow-flight/src/main/java/org/apache/beam/sdk/io/arrowflight/ArrowFlightIO.java","lineNumber":434,"sourceCode":"      String defaultHost = checkNotNull(spec.host(), \"host\");\n      SerializableEndpoint endpoint = source.endpoint;\n      if (endpoint == null) {\n        try (FlightClient discoveryClient =\n            createClient(allocator, defaultHost, spec.port(), spec.useTls())) {\n          FlightInfo info =\n              discoveryClient.getInfo(\n                  FlightDescriptor.command(\n                      checkNotNull(spec.command(), \"command\").getBytes(StandardCharsets.UTF_8)),\n                  spec.callOptions());\n          List<FlightEndpoint> endpoints = info.getEndpoints();\n          if (endpoints.isEmpty()) {\n            return false;\n          }\n          endpoint =\n              SerializableEndpoint.fromFlightEndpoint(endpoints.get(0), defaultHost, spec.port());\n        } catch (InterruptedException e) {\n          Thread.currentThread().interrupt();\n          throw new IOException(\"Interrupted while discovering Flight endpoints\", e);\n        }\n        currentSource = new FlightBoundedSource(spec, source.beamSchema, endpoint);\n      }\n\n      client =\n          createClient(\n              allocator,\n              endpoint.getHost(defaultHost),\n              endpoint.getPort(spec.port()),\n              spec.useTls());\n      stream = client.getStream(endpoint.getTicket(), spec.callOptions());\n      currentBatchIterator = Collections.emptyIterator();\n      return advance();\n    }\n\n    @Override\n    public boolean advance() throws IOException {\n      while (true) {","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/arrow-flight/src/main/java/org/apache/beam/sdk/io/arrowflight/ArrowFlightIO.java#L416-L452","documentation":"FlightBoundedSource's reader (start) was interrupted while discovering Flight endpoints via listFlights/getInfo; the interrupt flag is restored and an IOException('Interrupted while discovering Flight endpoints') is thrown. Endpoint discovery failed because the blocking call did not complete.","triggerScenarios":"Thread interruption during the endpoint discovery RPC inside start() — typically runner shutdown or cancellation while the reader initializes.","commonSituations":"Pipeline cancelled shortly after start, worker preemption, autoscaler killing workers mid-startup.","solutions":["Retry the pipeline run; interruption during startup is usually transient.","Check runner logs for shutdown/cancel signals preceding the interruption.","Ensure the Flight server's endpoint discovery responds quickly to avoid long blocking windows.","Keep worker lifetimes stable (avoid aggressive preemption during startup)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// verify endpoint discovery works before starting workers\nflightClient.listFlights(FlightInfo).forEach(...);","typeGuard":null,"tryCatchPattern":"try {\n  reader.start();\n} catch (IOException e) {\n  if (e.getMessage().contains(\"Interrupted while discovering Flight endpoints\")) {\n    // surface as retryable / restart source\n  }\n}","preventionTips":["Keep workers alive long enough for endpoint discovery to finish","Make the Flight service's listFlights/getInfo path fast and cached","Retry pipeline startup on transient interruption","Monitor for preemption shortly after worker start"],"tags":["arrow-flight","interrupted","endpoint-discovery","io"],"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"}