Skip to content

Commit 37309e1

Browse files
authored
UBERF-10383 Ignore premature close errors in datalake (#8743) (#9007)
Signed-off-by: Alexander Onnikov <[email protected]>
1 parent 08038e6 commit 37309e1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

services/datalake/pod-datalake/src/handlers/blob.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ export async function handleBlobGet (
8585

8686
pipeline(blob.body, res, (err) => {
8787
if (err != null) {
88+
// ignore abort errors to avoid flooding the logs
89+
if (err.name === 'AbortError' || err.code === 'ERR_STREAM_PREMATURE_CLOSE') {
90+
return
91+
}
8892
const error = err instanceof Error ? err.message : String(err)
8993
ctx.error('error writing response', { workspace, name, error })
9094
Analytics.handleError(err)

services/datalake/pod-datalake/src/handlers/image.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ async function writeFileToResponse (ctx: MeasureContext, path: string, res: Resp
239239

240240
pipeline(stream, res, (err) => {
241241
if (err != null) {
242+
// ignore abort errors to avoid flooding the logs
243+
if (err.name === 'AbortError' || err.code === 'ERR_STREAM_PREMATURE_CLOSE') {
244+
return
245+
}
242246
Analytics.handleError(err)
243247
const error = err instanceof Error ? err.message : String(err)
244248
ctx.error('error writing response', { error })

0 commit comments

Comments
 (0)