timotejroiko / net-ipc

A simple node.js IPC client-server with no dependencies
MIT License
29 stars 6 forks source link

RangeError [ERR_OUT_OF_RANGE] #4

Closed pilathor closed 1 year ago

pilathor commented 1 year ago

I get this crash error often on my server after a couple of hours send and receive message from one client. I think is related with the node version, I read something about the computation of the high watermark in node streams changed since node v18. I used Node v19.

RangeError [ERR_OUT_OF_RANGE]: The value of "size" is out of range. It must be <= 1GiB. Received 4.2_599_642_514_197_27e_+26 at new NodeError (node:internal/errors:399:5) at computeNewHighWaterMark (node:internal/streams/readable:368:11) at Readable.read (node:internal/streams/readable:416:27) at Socket.read (node:net:742:39) at Connection._read (/home/sysmonitor/repos/sysmonitor.services/node_modules/net-ipc/src/interfaces.js:96:22) at Connection._init (/home/sysmonitor/repos/sysmonitor.services/node_modules/net-ipc/src/connection.js:54:9) at Socket.emit (node:events:512:28) at emitReadable_ (node:internal/streams/readable:590:12) at process.processTicksAndRejections (node:internal/process/task_queues:81:21) { code: 'ERR_OUT_OF_RANGE' }

Awesome library!

timotejroiko commented 1 year ago

Hi!

I believe this issue is related to the handshake simulation, could you share your client and server configuration, and some info about your environment, for example if you're using a proxy?

pilathor commented 1 year ago

Hi!, Server is behind a aws network balancer that routing tcp to port 3000.

Server { port: 3000, listenOptions: { host: SERVER_LOCAL_IP } }

Client { host: SERVER_DOMAIN, port: 3000, reconnect: true, retries: 3, maxRetryTime: 5000 }

It works fine for long periods of time until eventually the error occurs.

timotejroiko commented 1 year ago

so i made some changes that maybe will help your issue, if you could test it by installing the master version from github npm i timotejroiko/net-ipc, let me know if there is any improvement.

I have a basic idea of what is happening but im still not exactly sure what is the actual cause, its like the server is receiving invalid data during a new connection/reconnection request

pilathor commented 1 year ago

great, testing right now, let you know.

timotejroiko commented 1 year ago

gonna go ahead and close this, let me know if it happens again