-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(backend): use websockets/ws instead of theturtle32/WebSocket-Node #10884
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #10884 +/- ##
===========================================
- Coverage 77.34% 77.33% -0.02%
===========================================
Files 740 740
Lines 70409 70428 +19
Branches 6423 6422 -1
===========================================
+ Hits 54459 54465 +6
- Misses 15950 15963 +13
|
|
noServer: true にしないとダメかも |
ローカルでは動いた |
フロントエンドのテストが失敗しているのは関係なさそう |
バックエンドも落ちたわ |
これは関係あるかも |
connection.once('close' が呼ばれてなさそうな雰囲気 |
謎 |
謎 |
何らかの理由でnestインスタンスがシャットダウンされてもstreaming処理が動いたままになってしまっていそうということは分かるけどなぜそうなるのかが不明 |
ヌァァァァァァァァァァァァァァァァァァァァァァァァァァァァァァァァァァンンンンオオオオンンオンオンオンオンンンンンンンンン゛ン゛!!!!!!!!!!!!!!!! |
Ctrl+Cした時masterがkillされないみたいな感じよな |
ローカルで動かすとメモリリークしまくる? |
NoteはuploadUrlにめっちゃ時間がかかってるっぽい |
uploadUrlってなんかストリーミングと関係あったっけと思ったら普通にあった misskey/packages/backend/test/utils.ts Lines 271 to 285 in b16fdaf
|
つまり 普通にストリーミングがバグってるだけだわ |
'connect' with pong: trueしても'connected'が返ってこない |
仕様だった |
わかった
をawaitしている間に misskey/packages/backend/test/utils.ts Line 307 in b16fdaf
が来てしまうため、connectできないということだった |
これはredis周りの話なので関係ない感じがある |
(redis周りというかprocess.exitが来てない感じがあり |
workerしか殺していない(workerのdied :(しか見えない) |
this.userがあるならthis.userProfileなどもあるという前提で書かれているからfetchが完了する前にメッセージ受け付けるようにすると何か不具合が起きそう |
fetchのPromiseを持っておいてawaitを必要な箇所に仕込めば良くねと思ったけど、なんか色々無理がありそう バックエンド側が準備できたらreadyメッセージを送って、クライアントにはそれを待たせるとかがいいのか? |
theturtle32/WebSocket-Node時代では普通にこれで動いてたけどwebsockets/wsで動かなくなった理由が分かっていない |
server.on('upgrade', のコールバック関数内でawait main.init(connection);しなくなったから説 |
あー前まではthis.fetchが終わらないとwsコネクションの確立自体してないからか |
this.#wss.emit('connection', の前にawait main.init(connection);する必要があるかも? |
server.on('upgrade' 内でMainStreamConnectionの初期化しょりやれば解決するかも |
🙏🏻🙏🏻🙏🏻 |
misskey-dev#10884) * perf(backend): use websockets/ws instead of theturtle32/WebSocket-Node Resolve misskey-dev#10883 * refactor * Update StreamingApiServerService.ts * Update StreamingApiServerService.ts * ✌️ * Update StreamingApiServerService.ts * fix main stream init * fix timing 2 * setIntervalの重複を避ける(気休め) * add comment * ✌️ --------- Co-authored-by: tamaina <[email protected]>
Resolve #10883
What
Why
Additional info (optional)
Checklist