-
Notifications
You must be signed in to change notification settings - Fork 14
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
Twirpscript fails with Error: EAGAIN
#7
Comments
Upon further investigation, it seems that the issue is caused by writing "large" buffers synchronously to stdout. I tested this by removing half of my proto files and running twirpscript successfully 100% of the time. Refactoring // Fails with EAGAIN when buffer too large
writeFileSync(process.stdout.fd, response.serializeBinary()); // Succeeds with large buffers
process.stdout.write(Buffer.from(response.serializeBinary().buffer)) |
Hey @4nte thanks for reporting this issue. What version of node are you using? Also, do you have an example repo that I could take a look at? Doing some digging I found this: nodejs/node#7439 (comment). I suspect that is the issue. |
I'm running node v16.11.0 on Manjaro 21.1.6 Here's an example repo. Steps to reproduce:
|
@4nte Thanks so much for the repro. I've published v0.0.22 which resolves the issue in your example. Let me know if you run into anything else! |
When running twirpscript this error occurs randomly, with no apparent cause.
Twirpscript was working fine for a while, then suddenly I started getting this error out of a blue.
Sometimes I need to run twirpscript few times in a row before it succeeds without the error. As if I have to wait for some lock to release, but there should be none.
The text was updated successfully, but these errors were encountered: