tatethurston / TwirpScript

A protobuf RPC framework for JavaScript and TypeScript
MIT License
141 stars 14 forks source link

Error: EAGAIN during `readSync` #208

Closed noahseger closed 1 year ago

noahseger commented 1 year ago

Similar to #7, we've seen stdin fail as the number of protobufs we're processing has increased:

buf generate
node:fs:738
  handleErrorFromBinding(ctx);
  ^

Error: EAGAIN: resource temporarily unavailable, read
    at Object.readSync (node:fs:738:3)
    at tryReadSync (node:fs:438:20)
    at readFileSync (node:fs:484:19)
    at file:///runner/_work/definitions/definitions/node_modules/twirpscript/compiler.js:4:15
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:526:24)
    at async loadESM (node:internal/process/esm_loader:91:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12) {
  errno: -11,
  syscall: 'read',
  code: 'EAGAIN'
}
Failure: plugin protoc-gen-twirpscript: exit status 1

Running under Node 16 in GitHub Actions:

      - uses: actions/setup-node@v3
        with:
          node-version: 16

All I've found so far is https://stackoverflow.com/questions/40362369/stdin-read-fails-on-some-input, and I don't know if you have the flexibility to read synchronously from /dev/stdin for portability.

tatethurston commented 1 year ago

Hey @noahseger, thanks for reporting. What version of twirpscript are you running?

tatethurston commented 1 year ago

I think I may have found a lead here: https://github.com/nodejs/help/issues/2663. I'll put out a release switching to process.stdin usage. Once I release that, if you could let me know if the issue stops or if you continue to see it, I'd really appreciate it.

noahseger commented 1 year ago

Hi @tatethurston , thanks for checking it out! We're running 0.0.61, and can definitely let you know whether or not it stops after that lands. This framework is the best 🤘

tatethurston commented 1 year ago

Awesome thanks Noah, I’ll let you know when I publish

tatethurston commented 1 year ago

This is fixed in 0.0.66. LMK if you run into any issues!

noahseger commented 1 year ago

Thanks @tatethurston! This passed our CI so we'll land it and watch for the error over the next week 🎉

tatethurston commented 1 year ago

Thanks @noahseger!

tatethurston commented 1 year ago

@noahseger how has the incidence of this error looked after 0.0.66?

noahseger commented 1 year ago

Hey Tate, seems super solid since we upgraded. Thanks again 🙌

On Mon, Dec 5, 2022, 11:25 PM Tate Thurston @.***> wrote:

@noahseger https://github.com/noahseger how has the incidence of this error looked after 0.0.66?

— Reply to this email directly, view it on GitHub https://github.com/tatethurston/TwirpScript/issues/208#issuecomment-1338782712, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5MYCDDJ6OKONV562R5A33WL3E6PANCNFSM6AAAAAASCV2VNE . You are receiving this because you were mentioned.Message ID: @.***>

tatethurston commented 1 year ago

Awesome, thanks Noah