{"record":{"id":"39ebc5c2de4eda8a","repo":"apache/seatunnel","slug":"requestid-is-not-found-in-requestfuturecache","errorCode":null,"errorMessage":"requestId is {} not found in RequestFutureCache","messagePattern":"requestId is (.+?) not found in RequestFutureCache","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-engine/seatunnel-engine-storage/imap-storage-plugins/imap-storage-file/src/main/java/org/apache/seatunnel/engine/imap/storage/file/disruptor/WALWorkHandler.java","lineNumber":87,"sourceCode":"                writer.write(iMapFileData);\n            } catch (IOException e) {\n                writeSuccess = false;\n                log.error(\"write orc file error, walEventBean is {} \", iMapFileData, e);\n            }\n            // return the result to the client\n            executeResponse(requestId, writeSuccess);\n            return;\n        }\n\n        if (type == WALEventType.CLOSED) {\n            // close writer and archive\n            writer.close();\n        }\n    }\n\n    private void executeResponse(long requestId, boolean success) {\n        if (null == RequestFutureCache.get(requestId)) {\n            log.warn(\"requestId is {} not found in RequestFutureCache\", requestId);\n            return;\n        }\n        try {\n            RequestFutureCache.get(requestId).done(success);\n        } catch (RuntimeException e) {\n            log.error(\"response error, requestId is {} \", requestId, e);\n        }\n    }\n}\n","sourceCodeStart":69,"sourceCodeEnd":97,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-storage/imap-storage-plugins/imap-storage-file/src/main/java/org/apache/seatunnel/engine/imap/storage/file/disruptor/WALWorkHandler.java#L69-L97","documentation":"When an IMAP storage WAL event completes, executeResponse looks up the client's waiting future in the static RequestFutureCache by requestId. If the map has no entry (already completed, removed after timeout, or a response from a previous/cold-replayed WAL log), it logs this warning and drops the response instead of completing a future.","triggerScenarios":"walEvent replays a WAL record whose requestId's future was already removed from RequestFutureCache (client timed out and removed it, or the node restarted and the cache is empty while old WAL entries are replayed).","commonSituations":"Client-side operation timeout removed the future before the WAL handler processed the write; replaying old WAL files on recovery whose requestIds are no longer registered; duplicate WAL entries processed twice.","solutions":["Verify client write timeouts are longer than WAL processing latency so futures are not removed before responses arrive","Check for duplicate processing of WAL events (e.g., re-reading the same log segment after recovery)","On recovery, tolerate this warning — it is expected for stale requestIds and no action is needed if it appears only during replay","Inspect RequestFutureCache cleanup logic (remove-after-done) to rule out premature removal"],"exampleFix":"// before\nRequestFutureCache.get(requestId).done(success);\n// after\nCompletableFuture<Boolean> future = RequestFutureCache.get(requestId);\nif (future != null) {\n    future.done(success);\n} else {\n    log.warn(\"requestId {} not found, possibly already timed out\", requestId);\n}","handlingStrategy":"validation","validationCode":"CompletableFuture<Boolean> f = RequestFutureCache.get(requestId);\nif (f == null) { log.warn(\"stale requestId {}\", requestId); return; }","typeGuard":"if (RequestFutureCache.get(requestId) == null) return;","tryCatchPattern":null,"preventionTips":["Keep client timeouts > WAL processing latency","Idempotently guard cache lookups before calling done()","Treat missing requestIds during WAL replay as normal"],"tags":["logging","wal","future-cache","recovery"],"backgroundTag":"record-not-found","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}