You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting a stack overflow error with large Java-based CDK CloudFormation stacks. This seems to be happening because the KernelHost.run() and KernelHost.processRequest() functions are mutually-recursive through the next callback.
RangeError: Maximum call stack size exceeded
at KernelHost.processRequest (/tmp/jsii-java-runtime4513439031470941034/jsii-runtime.js:6063:18)
at KernelHost.run (/tmp/jsii-java-runtime4513439031470941034/jsii-runtime.js:5970:14)
at processRequest (/tmp/jsii-java-runtime4513439031470941034/jsii-runtime.js:5970:45)
at KernelHost.processRequest (/tmp/jsii-java-runtime4513439031470941034/jsii-runtime.js:6066:16)
at KernelHost.run (/tmp/jsii-java-runtime4513439031470941034/jsii-runtime.js:5970:14)
at processRequest (/tmp/jsii-java-runtime4513439031470941034/jsii-runtime.js:5970:45)
at KernelHost.processRequest (/tmp/jsii-java-runtime4513439031470941034/jsii-runtime.js:6066:16)
at KernelHost.run (/tmp/jsii-java-runtime4513439031470941034/jsii-runtime.js:5970:14)
at processRequest (/tmp/jsii-java-runtime4513439031470941034/jsii-runtime.js:5970:45)
at KernelHost.processRequest (/tmp/jsii-java-runtime4513439031470941034/jsii-runtime.js:6066:16)
at software.amazon.jsii.JsiiRuntime.processErrorResponse(JsiiRuntime.java:112)
at software.amazon.jsii.JsiiRuntime.requestResponse(JsiiRuntime.java:84)
at software.amazon.jsii.JsiiClient.callMethod(JsiiClient.java:185)
at software.amazon.jsii.JsiiObject.jsiiCall(JsiiObject.java:57)
[our stack...]
I will submit a PR with a test and fix shortly.
The text was updated successfully, but these errors were encountered:
Fixes#778. This PR eliminates the mutual recursion between `KernelHost.run()` and `KernelHost.processRequest()` by scheduling the recursive `KernelHost.run()` call to run on the next iteration of the event loop.
The code change has been tested as follows:
- by running the stress-test script with and without the change to confirm that the crash occurs without the change and does not occur with the change;
- by running the unit tests to confirm that behavior is consistent;
- by synthesizing our internal CDK stack and confirming that the crash does not occur and that resources are generated correctly.
🐛 Bug Report
Affected Languages
TypeScript
orJavascript
Python
Java
C#
,F#
, ...)General Information
What is the problem?
I am getting a stack overflow error with large Java-based CDK CloudFormation stacks. This seems to be happening because the
KernelHost.run()
andKernelHost.processRequest()
functions are mutually-recursive through thenext
callback.I will submit a PR with a test and fix shortly.
The text was updated successfully, but these errors were encountered: