| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Fix storage connections leaking when asset requests are cancelled (#28076) * fix: release storage streams that nothing consumes Asset and extension requests hand a stream to a consumer that can die early. Several paths dropped that stream without destroying it, and an unread stream keeps a connection checked out of the driver's pool (or an open file handle) for the lifetime of the process. Once maxSockets worth pile up, every storage call starves. - GET /assets/:id, GET /extensions/sources/:chunk and both zip routes: the client can disconnect during the await that opens the stream, so the res close handler was registered too late to fire - transform cache miss: a failed write left the source read stream open, and a read error only unpiped, so the write never settled and the request hung forever holding the stream - zip: streams handed to the archive are never read once it dies, and an archive error was neither reported nor cleaned up - importOne: a rejected MIME type left the fetched response body open The reported symptom was a bare 403 rather than a storage error because exists() caught everything and returned false. It now only reports false for a confirmed missing file, so callers stop acting on a failed lookup: assets answers 503, and extension sync keeps the local copy instead of deleting it. * Address review: shared disconnect util, cancel unread bodies, wrap remaining exists() callers * Cover azure/gcs test-only changes in the driver changeset * Merge changesets into one per review * simplify chunk handler * add tests for destroyOnDisconnect * Fold stream release into the single close listener --------- Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com> | 2 个月前 | |
Fix storage connections leaking when asset requests are cancelled (#28076) * fix: release storage streams that nothing consumes Asset and extension requests hand a stream to a consumer that can die early. Several paths dropped that stream without destroying it, and an unread stream keeps a connection checked out of the driver's pool (or an open file handle) for the lifetime of the process. Once maxSockets worth pile up, every storage call starves. - GET /assets/:id, GET /extensions/sources/:chunk and both zip routes: the client can disconnect during the await that opens the stream, so the res close handler was registered too late to fire - transform cache miss: a failed write left the source read stream open, and a read error only unpiped, so the write never settled and the request hung forever holding the stream - zip: streams handed to the archive are never read once it dies, and an archive error was neither reported nor cleaned up - importOne: a rejected MIME type left the fetched response body open The reported symptom was a bare 403 rather than a storage error because exists() caught everything and returned false. It now only reports false for a confirmed missing file, so callers stop acting on a failed lookup: assets answers 503, and extension sync keeps the local copy instead of deleting it. * Address review: shared disconnect util, cancel unread bodies, wrap remaining exists() callers * Cover azure/gcs test-only changes in the driver changeset * Merge changesets into one per review * simplify chunk handler * add tests for destroyOnDisconnect * Fold stream release into the single close listener --------- Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com> | 2 个月前 |