{"record":{"id":"3563a15d4020b159","repo":"apache/beam","slug":"error-closing-flight-write-connection-during-teardown","errorCode":null,"errorMessage":"Error closing Flight write connection during teardown","messagePattern":"Error closing Flight write connection during teardown","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/java/io/arrow-flight/src/main/java/org/apache/beam/sdk/io/arrowflight/ArrowFlightIO.java","lineNumber":675,"sourceCode":"      } catch (RuntimeException e) {\n        if (failure == null) {\n          failure = e;\n        } else {\n          failure.addSuppressed(e);\n        }\n      }\n\n      if (failure != null) {\n        throw failure;\n      }\n    }\n\n    @Teardown\n    public void teardown() {\n      try {\n        closeConnection();\n      } catch (RuntimeException e) {\n        LOG.warn(\"Error closing Flight write connection during teardown\", e);\n      }\n    }\n\n    private void ensureConnection() {\n      if (client == null) {\n        BufferAllocator currentAllocator = new RootAllocator(Long.MAX_VALUE);\n        allocator = currentAllocator;\n        FlightClient currentClient =\n            createClient(\n                currentAllocator, checkNotNull(spec.host(), \"host\"), spec.port(), spec.useTls());\n        client = currentClient;\n\n        org.apache.arrow.vector.types.pojo.Schema arrowSchema =\n            ArrowConversion.ArrowSchemaTranslator.toArrowSchema(beamSchema);\n        VectorSchemaRoot currentRoot = VectorSchemaRoot.create(arrowSchema, currentAllocator);\n        root = currentRoot;\n\n        FlightDescriptor descriptor =","sourceCodeStart":657,"sourceCodeEnd":693,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/arrow-flight/src/main/java/org/apache/beam/sdk/io/arrowflight/ArrowFlightIO.java#L657-L693","documentation":"WARN logged in the @Teardown method of ArrowFlightIO's write function: closeConnection() threw a RuntimeException during teardown. Teardown is best-effort, so the exception is caught and logged instead of failing the bundle; the write connection and its resources are simply abandoned, which the runner's own process cleanup handles.","triggerScenarios":"Thrown at sdks/java/io/arrow-flight/src/main/java/org/apache/beam/sdk/io/arrowflight/ArrowFlightIO.java:675 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the logged exception to find why the Flight connection failed to close (server down, network)","Ensure Flight servers remain reachable through job teardown, or accept the leak-free abandonment"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}