-
Notifications
You must be signed in to change notification settings - Fork 651
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/grpc-js: SIGABRT with worker threads (Assertion `onread->IsFunction()' failed.) #1799
Comments
From my point of view, if it is possible to use a JavaScript API in such a way that it causes the interpreter to crash, that is always a bug with Node itself. The fact that this specifically happens under heavy load makes that even more likely; grpc-js does not behave any differently under heavy load, so I assume this is a problem with some internal data structure. |
I guess so, if grpc-js is only using public APIs. As long as my repro requires grpc-js the Node.js team will probably not take it seriously. And with the vanilla http2 client/server (with the most basic hello world from the docs) I've surfaced a seemingly unrelated race condition. Maybe someone with knowledge of how grpc-js internally uses the http2 module could update HEAD of https://github.com/Prinzhorn/electron-sigabrt to repro the SIGABRT instead of the FATAL ERROR it's causing.
The load only increases the chances of it happening, since this is a race condition with timing the |
Looking at the linked Node issue again, I think including the two different "abort" errors in that one issue confused things, and I don't think they're dismissing the original bug that happened with grpc-js just because another library is using the API. I think they were just saying that the second error that you found using the vanilla http2 APIs is different than the original bug you filed. |
I don't think this is a gRPC bug. |
Problem description
I kept getting SIGABRT every like 100 times I closed my Electron app. I was able to narrow this down to the @grpc/grpc-js package. It happens when a worker thread is terminated just before a @grpc/grpc-js server tries to read on the stream.
It is potentially caused by the underlying http/2 module. But with just http/2 it'll result in a "FATAL ERROR:" (nodejs/node#38418 (comment)), which might be completely unrelated or maybe it masks the SIGABRT. Or the SIGABRT is caused by how @grpc/grpc-js is using http/2 (e.g. where did
onread
go?) and not related to http/2 itself at all.Reproduction steps
Repo is here https://github.com/Prinzhorn/electron-sigabrt
Please note that it does no longer require Electron at all (as the name suggests), it was stripped down.
Also HEAD does not use @grpc/grpc-js (because I stripped it away and uncovered the bug in http/2 module), you need to check out commit
45caa541d9d16bbeb1b7a9e31ebbd59e61381b7d
What the repo does is start a grpc server inside a worker thread and then bombard it with requests. The worker is terminated after 2s and this will reliable cause the whole process to SIGABRT if it happens at the right time.
vokoscreen-2021-05-25_18-21-37.mp4
Environment
The text was updated successfully, but these errors were encountered: