{"record":{"id":"b26d085c508fbc9d","repo":"quarkusio/quarkus","slug":"java-lang-runtimeexception-wrapping-the-underlying","errorCode":null,"errorMessage":"java.lang.RuntimeException wrapping the underlying InterruptedException/ExecutionException (no own message)","messagePattern":"java\\.lang\\.RuntimeException wrapping the underlying InterruptedException/ExecutionException \\(no own message\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/amazon-lambda/event-server/src/main/java/io/quarkus/amazon/lambda/runtime/MockEventServer.java","lineNumber":313,"sourceCode":"        }\n    }\n\n    @Override\n    public void close() throws IOException {\n        if (!closed.compareAndSet(false, true)) {\n            return;\n        }\n        log.info(\"Stopping Mock Lambda Event Server\");\n        for (var i : responsePending.entrySet()) {\n            i.getValue().response().setStatusCode(503).end();\n        }\n        for (var i : queue) {\n            i.response().setStatusCode(503).end();\n        }\n        try {\n            httpServer.close().toCompletionStage().toCompletableFuture().get();\n        } catch (InterruptedException | ExecutionException e) {\n            throw new RuntimeException(e);\n        } finally {\n            try {\n                vertx.close().toCompletionStage().toCompletableFuture().get();\n            } catch (InterruptedException | ExecutionException e) {\n                throw new RuntimeException(e);\n            } finally {\n                blockingPool.shutdown();\n            }\n        }\n    }\n}\n","sourceCodeStart":295,"sourceCodeEnd":325,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/amazon-lambda/event-server/src/main/java/io/quarkus/amazon/lambda/runtime/MockEventServer.java#L295-L325","documentation":"MockEventServer.close() blocks on the Vert.x HTTP server close future via get(). If closing the server is interrupted or fails, the InterruptedException/ExecutionException is wrapped in a RuntimeException with no message of its own. This is cleanup-shutdown failure from the mock Lambda event server.","triggerScenarios":"Calling mockEventServer.close() (or JVM shutdown hook invoking it) while the underlying Vert.x httpServer.close() future fails or the thread is interrupted.","commonSituations":"Test teardown races where requests are still in flight; the server was already stopped; port shutdown hanging in CI; interrupting the test thread during close.","solutions":["Ensure all in-flight requests complete before calling close()","Only call close() once; repeated shutdowns can fail","Check the wrapped cause via getCause() for the real server error","If interrupted, restore the interrupt flag instead of swallowing it"],"exampleFix":"// before\nmockEventServer.close();\n// after\ntry {\n    mockEventServer.close();\n} catch (RuntimeException e) {\n    LOGGER.warn(\"mock server close failed\", e.getCause());\n}","handlingStrategy":"try-catch","validationCode":"if (!server.isStarted()) return; // don't close what isn't running","typeGuard":null,"tryCatchPattern":"try { server.close(); } catch (RuntimeException e) { LOGGER.warn(\"close failed\", e.getCause()); }","preventionTips":["Drain in-flight requests before close","Close exactly once in teardown","Log e.getCause() to surface the real failure"],"tags":["shutdown","vertx","amazon-lambda","mock-server"],"backgroundTag":"shutdown-failure","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}