amplitude / amplitude/Amplitude-Node

Default retry behavior causes infinite event loop on error

オープン
#87 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
TypeScript
スター
73
フォーク
20
PR マージ指標
30日以内にマージされた PR はありません

説明

There's a flaw in the default retry behavior on [line 59](https://github.com/amplitude/Amplitude-Node/blob/main/packages/node/src/retry/defaultRetry.ts#L59): whenever an error occurs, a new call stack is created and we immediately return.

Instead of returning, we should `await this._onEventsError` here and ensure that onEventsError is a promise.

Currently waiting for amplitude.flush causes the node.js event loop to never clear in the case of a rate limit error.

Here's an example integration test without a rate limit using jest:
Screen Shot 2021-03-13 at 5 28 10 PM

And here's one with a rate limit, notice how jest never exits:
Screen Shot 2021-03-13 at 5 28 42 PM

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

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

評価

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

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

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