-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to call .getStackName on Stack in Java with Node 12.17.0 #8288
Comments
I can confirm this issue isn't specific to java, I have reproduced this in python, and was going to report the same myself. It appears to be caused by the jsii process which is listening to the java/python (the big "HACK" warning is a bit of a giveaway) https://github.com/aws/jsii/blob/master/packages/%40jsii/runtime/lib/sync-stdio.ts#L57 As a workaround to that we found we were tripping this instance by taking too long (making an external call) in the python code so. Perhaps you can refactor your similarly. (I could also see this happening if you were to do something like You can reproduce this easy on Linux like so, but it doesn't appear to cause the issue natively on osx (presumably to do with the socket handling)
|
Thanks for the slightly updated issue with more detail. However I'm fairly sure with the new description you're now hitting a completely different error! (Certainly it no-longer appears to be the call stack overflow from before, so I may have to raise a separate issue pending someone else reviewing this) |
@cadnce I accidentally showed only the abbreviated stack trace after rewriting the ticket to have a reproducable example. I now added the full stack trace and AFAIK it it still essentially the same ( |
adding the jsii label and assigning to @RomainMuller to take a look |
Yes sorry, perhaps I misread what it said before as it looked too much like my issue! I thought your backtrace from cdk was originally complaining about I've obviously confused the issue here so I'll raise a separate issue for it |
I did also occasionaly get |
So the real issue here is actually the The issue stems from our reading synchronously from |
Yea that was my point exactly 👍 |
…eadLine When using node `>= 12.17`, `EAGAIN` errors consistently occur when trying to read from `stdin` when there is no available data. The retry mechanism for this was to recursively call back `SyncStdio.readLine`, which could evtnually lead to a "Maximum call stack size exceeded" error to occur (possibly hidden from the consumer, and later causing a "Stream closed" error). This changes how the retry mechanism works so it operates in a `while` loop instead of making a recursive call, completely avoiding to run into the growing stack issue. Fixes aws/aws-cdk#8288 Fixes aws/aws-cdk#5187
Fun stuff is the It's possible (probable?) your regular program also hit that, but never showed it out to you (you'd have had to run with |
Also - I found myself unable to write a simple reproduction for this behavior of |
Interesting, thanks I'll try again with those environment variables and give you my result (I also found on osx it didnt give the same EAGAIN socket behaviour compared to on a Debian VM) I couldn't reproduce this using node/TS cdk because it doesn't use the jsii (obviously). I should note I'm suspicious that something has changed in cdk space recently making this worse because I've spotted at least 3 references to people with this same issue in the gitter chat since this issue (sorry I don't have the links to hand) |
Wow, actually you have already PR'd this, amazing |
…eadLine (#1717) When using node `>= 12.17`, `EAGAIN` errors consistently occur when trying to read from `stdin` when there is no available data. The retry mechanism for this was to recursively call back `SyncStdio.readLine`, which could evtnually lead to a "Maximum call stack size exceeded" error to occur (possibly hidden from the consumer, and later causing a "Stream closed" error). This changes how the retry mechanism works so it operates in a `while` loop instead of making a recursive call, completely avoiding to run into the growing stack issue. Fixes aws/aws-cdk#8288 Fixes aws/aws-cdk#5187 Fixes aws/aws-cdk#8397 --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
I am using CDK from a REPL in Clojure (Java). After upgrading Node to
12.17.0
(the latest release of major version12
, which is recommended for use with CDK/JSII), commands start failing due tostream closed
error.Reproduction Steps
12.17.0
.brew install clojure/tools/clojure
).clj -Sdeps '{:deps {software.amazon.awscdk/core {:mvn/version "1.42.0"}}}'
.(import software.amazon.awscdk.core.App software.amazon.awscdk.core.Stack$Builder)
Stack
object asbar
(.getStackName bar)
Error Log
You can see a detailed stack trace of the last exception by evaluating
*e
in the REPL:Environment
Other
12.16.3
(the last release before12.17.0
) throws no exception and just works.ctrl+d
."foo"
):200ms
between creating the Stack and getting its name works:1000ms
will throw the exception:13.x
, but so far the recommendation was always to downgrade to12.x
. Now that the latest release of12.x
is apparently also affected, this workaround is problematic since a lot of tooling (e.g. homebrew with versions plugin) doesn't allow installing a specific minor version.This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: