-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Description
Describe the bug
The uploadFile
/ uploadChunk
code throws inside of a node stream callback (.on('error')
), which is not propagated properly through the async functions and leads to failures even though all cache calls are wrapped in try/catch.
toolkit/packages/cache/src/internal/cacheHttpClient.ts
Lines 254 to 258 in f1b118b
.on('error', error => { | |
throw new Error( | |
`Cache upload failed because file read failed with ${error.message}` | |
) | |
}), |
To Reproduce
Not quite sure, I think there was something wrong with the infrastructure or whatever. I got these failures on both Windows and macOS:
https://github.com/getsentry/sentry-rust/runs/1283097472
Warning: uploadChunk (start: 234881024, end: 268435455) failed: write EPIPE
/Users/runner/work/_actions/Swatinem/rust-cache/v1/dist/save/index.js:339
throw new Error(`Cache upload failed because file read failed with ${error.message}`);
^
Error: Cache upload failed because file read failed with EBADF: bad file descriptor, read
at ReadStream.<anonymous> (/Users/runner/work/_actions/Swatinem/rust-cache/v1/dist/save/index.js:339:31)
at ReadStream.emit (events.js:210:5)
at internal/fs/streams.js:167:12
at FSReqCallback.wrapper [as oncomplete] (fs.js:470:5)
Expected behavior
There should be no unhandled exception being raised outside the promise chain.
pimeys and guy-shahine