{"record":{"id":"73039e5161daa2bd","repo":"apache/seatunnel","slug":"failed-to-delete-point-in-time-with-id","errorCode":null,"errorMessage":"Failed to delete Point-in-Time with ID: {}","messagePattern":"Failed to delete Point-in-Time with ID: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/source/ElasticsearchSourceReader.java","lineNumber":259,"sourceCode":"                                sourceIndexInfo.getSource(),\n                                sourceIndexInfo.getQuery(),\n                                sourceIndexInfo.getPitBatchSize(),\n                                sourceIndexInfo.getSearchAfter(),\n                                sourceIndexInfo.getPitKeepAlive(),\n                                sourceIndexInfo.getRuntimeFields(),\n                                sourceIndexInfo.getSliceId(),\n                                sourceIndexInfo.getSliceMax());\n\n                // Output the results\n                outputFromPitResult(pitResult, sourceIndexInfo, output, deserializer);\n            }\n        } finally {\n            // Always clean up the PIT when done\n            if (pitOwnedByReader && pitId != null) {\n                try {\n                    esRestClient.deletePointInTime(pitId);\n                } catch (Exception e) {\n                    log.warn(\"Failed to delete Point-in-Time with ID: {}\", pitId, e);\n                }\n            }\n        }\n    }\n\n    private void outputFromScrollResult(\n            ScrollResult scrollResult,\n            ElasticsearchConfig elasticsearchConfig,\n            Collector<SeaTunnelRow> output,\n            SeaTunnelRowDeserializer deserializer) {\n        List<String> source = elasticsearchConfig.getSource();\n        String tableId = elasticsearchConfig.getCatalogTable().getTablePath().toString();\n        for (Map<String, Object> doc : scrollResult.getDocs()) {\n            SeaTunnelRow seaTunnelRow =\n                    deserializer.deserialize(new ElasticsearchRecord(doc, source, tableId));\n            output.collect(seaTunnelRow);\n        }\n    }","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/source/ElasticsearchSourceReader.java#L241-L277","documentation":"A WARN log from ElasticsearchSourceReader.searchWithPointInTime: deleting the Point-in-Time (PIT) search context (DELETE /_pit) failed after reading. Data is unaffected; the PIT context remains open on Elasticsearch until it times out, holding file descriptors/segments open. pitOwnedByReader guards that only the owner deletes it.","triggerScenarios":"scrollSearchResult -> searchWithPointInTime completes and finally calls esRestClient.deletePointInTime(pitId); the call fails due to network error, node restart, the PIT already expiring (keep_alive exceeded), or ES rejecting the unknown pit_id.","commonSituations":"Long batch reads exceeding the PIT keep_alive; Elasticsearch cluster rolling restart mid-job; running multiple readers where PIT sharing/ownership is misconfigured; auth changes between PIT creation and deletion.","solutions":["Increase the PIT keep_alive in the source config so it outlives the read","Confirm network/auth to Elasticsearch and cluster stability for the job duration","If PITs accumulate, close stale ones manually: DELETE /_pit {\"id\":\"<logged pitId>\"}","Check pitOwnedByReader logic when sharing PITs across reader subtasks"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// confirm PIT endpoint available and auth valid\n// curl -X POST 'https://es-host:9200/<index>/_pit?keep_alive=10m'","typeGuard":null,"tryCatchPattern":"// non-fatal; if PITs leak, close manually:\n// curl -X DELETE 'https://es-host:9200/_pit' -H 'Content-Type: application/json' -d '{\"id\":\"<pitId from log>\"}'","preventionTips":["Set keep_alive larger than the expected read duration","Avoid sharing one PIT across readers unless ownership is configured correctly","Watch open PIT context metrics on the ES cluster"],"tags":["elasticsearch","point-in-time","cleanup"],"backgroundTag":"http-error-response","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}