Voxelum / minecraft-launcher-core-node

Provide packages to install Minecraft, launch Minecraft and more to build launcher with NodeJs/Electron!
https://docs.xmcl.app/en/core/
MIT License
174 stars 25 forks source link

DownloadTask should manage fd properly #201

Closed dozono closed 1 year ago

dozono commented 3 years ago

If the first download validation failed, the next retry will have problem with the closed fd.

portwatcher commented 3 years ago

An error related with it goes like this:

[ERROR] [2021/7/31上午1:37:20] Uncaught Exception
[ERROR] [2021/7/31上午1:37:20] RangeError [ERR_OUT_OF_RANGE]: The value of "fd" is out of range. It must be >= 0 && <= 2147483647. Received -1
[CONSOLE]     at Object.write (fs.js:641:3)
[CONSOLE]     at WriteStream._write (internal/fs/streams.js:396:13)
[CONSOLE]     at writeOrBuffer (internal/streams/writable.js:358:12)
[CONSOLE]     at WriteStream.Writable.write (internal/streams/writable.js:303:10)
[CONSOLE]     at IncomingMessage.ondata (internal/streams/readable.js:719:22)
[CONSOLE]     at IncomingMessage.emit (events.js:327:22)
[CONSOLE]     at IncomingMessage.Readable.read (internal/streams/readable.js:519:10)
[CONSOLE]     at flow (internal/streams/readable.js:992:34)
[CONSOLE]     at resume_ (internal/streams/readable.js:973:3)
[CONSOLE]     at processTicksAndRejections (internal/process/task_queues.js:80:21) {
[CONSOLE]   code: 'ERR_OUT_OF_RANGE'
[CONSOLE] }
ci010 commented 1 year ago

Should be fixed in new version.