firebase / firebase/firebase-admin-node

Request hangs up on connection destroy when parsing response stream

オープン
#2,105 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
api: messaging
主要言語
TypeScript
スター
1.7k
フォーク
419
平均マージ
3日 10時間
マージ済み PR(30日)
16

説明

### Environment

* Operating System version: Linux
* Firebase Admin SDK version: 11.5.0
* Firebase Product: messaging (api-request)
* Node.js version: v16.18.1
* NPM version: 8.19.2

### The problem

#### Steps to reproduce:

That error often happens under heavy load when i call multiple _messaging.sendAll_ in parallel.
Firebase server accidentally closes connection when parsing multipart response via _busboy_.
That behavior causing hanging up whole request (_messaging.sendAll_) because of ignored response error.

#### Relevant Code:

Error that happens when receiving response is ignored and not handled properly.
[src/utils/api-request.ts:489](https://github.com/firebase/firebase-admin-node/blob/master/src/utils/api-request.ts#L488)
If i add error handling to response, then i see ECONNRESET error and aborted flag on response object:

```typescript
const req: http.ClientRequest = transport.request(this.options, (res: http.IncomingMessage) => {
res.on('error', (err) => {
console.log(err);
});
this.handleResponse(res, req);
});
```

I propose to add response error handling likewise request error.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。