tatethurston/TwirpScript

Error: EAGAIN during `readSync`

Closed this issue · 10 comments

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.

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

I think I may have found a lead here: nodejs/help#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.

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 🤘

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

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

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

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

Awesome, thanks Noah