Socket closing without prompt
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- javascript, node.js
- 領域
- networking
調査の方向性
まず、レポートに示されている socket connect options と serverFromRequest.subscription.onUnsubscribe callback を確認し、socket を閉じる、または購読解除する条件に注目します。ファイル名やテスト名の指定はありません。関連する購読解除ケースを特定し、reconnect、timeout、または heartbeat の設定が本番環境での挙動を説明できるかどうかを判断できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Support plan
- is this issue currently blocking your project? (yes/no): no
- is this issue affecting a production system? (yes/no): yes
Context
- node version: 16.0
- module version: 12.0.4
- environment (e.g. node, browser, native): browser (and node)
- used with (e.g. hapi application, another framework, standalone, ...): hapi application
- any other relevant information:
How can we help?
Some users in production are being unsubscribe from the socket without us really knowing why. Their internet access is supposedly stable...
I feel I am missing some cases of automatic unsubscribe so I must ask : what are the different cases where the socket might trigger the onUnsubscribe function ?
Here are the different declarations:
/**CLIENT CODE connection **/
return this.socketClient.connect({
reconnect: true, //whether the client should try to reconnect
delay: 2000, //time in milliseconds to wait between each reconnection attempt, cumulative
maxDelay: 15000, //the maximum delay time in milliseconds between reconnections
retries: 10 //number of reconnection attempts
})
/** SERVER REGISTER **/
await server.register(
{
plugin: Nes,
options: {
heartbeat: {
interval: 15000,
timeout: 5000
},
auth: false
}
},
{
routes: process.env.ROOT_PATH ? {
prefix: ROOT_PATH
} : {}
}
);
this.serverFromRequest.subscription(this.subscribingPath , {
onSubscribe: (socket, path, params)=>{
/** SOME CODE that has nothing to do with network **/
//Managing page reloading by clearing a timeout
if (this.onUnsubscribeTimeout) {clearTimeout(this.onUnsubscribeTimeout)}
},
onUnsubscribe: (socket, path, params)=>{
/** SOME CODE that has nothing to do with network **/
const unloadTimeout = 15000;
this.onUnsubscribeTimeout = setTimeout(()=>{
/** SOME CODE saying what should happen when socket is closed ( basically send message to client saying Chat is closed)
}, unloadTimeout)
}
})
What do you think ?
Is the fact maxDelay very closed to unloadTimeout could explain the issue ?
Are my connect options not precise enough or too low ? Or the heartbeat maybe ?
What would be good production values according to your knowledge ?
Regards and thank you for nes !
- 主要言語
- JavaScript
- スター
- 502
- フォーク
- 85
- 平均マージ
- 16日 16時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
hapijs/nes のほかの issue
-
Listener does not correctly handle optional & wildcard routes.再び着手できるかも @damusix が 214 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
-
support
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
support
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 83/100
module-federation/core#5205 ·
メンテナーはふだん 1 日以内に返信
-
affects:v0.5.2 area:frontend audit:ui-ux-2026-10 bug priority:P2
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
berntpopp/kidney-genetics-db#326 ·
メンテナーはふだん 1 日以内に返信
-
task
難易度 1/5 1時間未満 初心者へのやさしさ 83/100
TAMULib/fw-registry#550 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
-
NWCWalletService.subscribe: response is never published if the handler finishes after unsubscribe (regression in 8.1.0)対応中かも @ajaysehwal が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100