NatLee / telepy

A Django-based web application for managing and monitoring the reverse SSH tunnels or jump servers.
MIT License
4 stars 1 forks source link

訪問web terminal後會造成延遲問題 #1

Closed NatLee closed 4 months ago

NatLee commented 4 months ago

如題,有一個延遲bug

復現方式:

  1. 先隨意使用任一web terminal (有沒有連通沒關係)

image

  1. 關閉後,回到首頁測試其他API會有明顯延遲

image

正常沒開過terminal的話,時間是這樣

image


目前推測是開啟terminal的這段 Event loop 造成其他服務延遲 https://github.com/NatLee/telepy/blob/main/src/tunnels/consumers.py#L73

有待釐清QQ

h-alice commented 4 months ago

根據目前資料,假如直接kill writer程序,會有可能讓reader卡在無限讀出空字串的情形,這會造成event loop blocking https://github.com/NatLee/telepy/blob/7be26cc1ac825e7c9eb99db3340861fb6ffec926/src/tunnels/consumers.py#L73

NatLee commented 4 months ago

已在這次commit修正 :3

https://github.com/NatLee/telepy/commit/710afdca1b41a703654707c5d6dffe8e7c67323a