-
Notifications
You must be signed in to change notification settings - Fork 148
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
GRPC-JS: Possible EventEmitter memory leak detected #661
Comments
I believe that this is an issue in grpc-js. See: grpc/grpc-node#694 (comment) The user report indicates that this happens when a client repeatedly cannot connect to the backend. |
@schmidt-sebastian this happens when run a lot of operations at once i.e. i have a function to wipe my development database and it looks something like this ['Collection1', 'Collection2', 'Collection3'].map((collection) => {
const data = await firestore.collection(collection).select().get();
return data.docs.map((doc) => firestore.collection(collection).doc(doc.id).delete());
}); When my database is rather full, this error pops up hundreds of times. This also happens when I onboard large users to my application - a lot of documents are being created/updated (different from contention on a single document), often in parallel functions like above^. |
I believe this happens when there are more than 10 outstanding requests (with pending DeadlineFilters) on a single HTTP2 channel. For me, this does not reproduce over fast networks, but reproduces reliably when I turn on package loss (using Apple's Network Link Conditioner). A test that can be used to reproduce is https://github.com/googleapis/nodejs-firestore/blob/master/dev/system-test/firestore.ts#L928 I will ping the GRPC team directly to prioritize this issue. |
grpc-js version 0.4.1 includes a fix for this issue. If you update your dependencies, you should receive this version (google-gax pulls in 0.4.x). You might have to update/delete your package lock files. |
We had to revert grpc-js back to 0.4.0. I am re-opening this issue. |
This happens with my firestore node server setup always on startup (where I begin listening to several collections) ever since i upgraded to |
@jmacedoit Sorry to hear about your troubles. We will get this fixed as soon as we sort out the remaining issues with |
@schmidt-sebastian any update on this? I am having critical problems with firestore related to this bug. is there a fix in the meantime to revert? |
This has been fixed with the release of |
I'm still getting this error, here's the output of
Is the |
@guanzo Are you using datastore when you see these errors? The EventEmitter warning might come from the old version of grpc-js bundled with google-gax < 1.0. I can certainly try to reproduce this issue again with the newest version of grpc-js, but for me the warnings went away as of 0.4.1. You should be able to listen forever, and we reconnect for you. In general, will we abort a listen stream only if we fail to reconnect 10 times in a row. |
I'm seeing the same thing as @guanzo. And the only occurrences of
Note that the warning messages are slighty different also. Now we get:
as opposed to
|
I will work with the GRPC JS team to get this one fixed as well. Sorry for all the trouble with this new networking layer, but shipping a 50MB+ C-dependency (the old GRPC core) was never something we were proud of. |
@schmidt-sebastian And you people have been doing great. From what I've seen in the past few weeks, I believe that we will soon be able to enjoy an error/warning free and very robust SDK. Keep up with the good work 🥇 |
@jmacedoit Are you able to help us debug over at grpc/grpc-node#916? |
Re-opening this issue for additional visibility. |
@schmidt-sebastian Yes I'm trying to reproduce it again. |
I've encountered this problem for a couple of weeks. My packages/dependencies are the same as @jmacedoit The subscription is starting and everything looks fine until about 4 hours of idling, I get this error
That's all I have atm, I will try to find out more |
Thanks for the fix 👍 , will upgrade now and report any errors. |
@thebrianchen @schmidt-sebastian It is still an issue - latest @google-cloud/firestore (2.3.0) and latest grpc@grpc-js (0.5.3). Stack trace:
It happens not only in my local environment, but also in a production firebase function. |
Also happening here, GCP Function w/ Firestore + KMS @google-cloud/firestore": "2.3.0"
|
can confirm |
It is still an issue: @google-cloud/[email protected]
|
Issue over here as well: $ npm ls @grpc/grpc-js
|
FWIW, i'm still on |
@MarkChrisLevy @krufebird @guanzo This is a regression in the latest release of The corresponding issue is: grpc/grpc-node#1027 |
@schmidt-sebastian How to pin the grpc version without adding that to package.json? Add it to package-lock.json would be fine. I tried |
@schmidt-sebastian Yep, [email protected] is ok. Thanks. |
@lzl124631x If you have a package-lock.json, you can remove the dependency from "package.json" one it is in the lockfile. |
@schmidt-sebastian ic. Thanks! |
I found @grpc/[email protected] in firebase-admin:
Upgrading to [email protected] fixed it
|
I referenced this issue in this new issue It seems almost certainly related so you might want to check it out |
See #623 (comment)
The text was updated successfully, but these errors were encountered: