8go / 8go/matrix-commander

Enhancement: Matrix commander is slow, it seems to temporarily hang due to syncing

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

説明

Hi,

I'm testing this software and no matter what I try to do it always freeze for one minute after finally doing what I want.

I wanted to send a message to a specific room, I issued this command :

```
time matrix_commander/matrix-commander --debug --message "wtf is this taking too much time" --room "!REDACTED:matrix.org"
```
```
2022-08-22 08:13:59,747: DEBUG: matrix-commander: Debug is turned on. debug count=1
2022-08-22 08:13:59,748: DEBUG: matrix-commander: Separator is set to " " of length 4. E.g. Col1 Col2.
2022-08-22 08:13:59,748: DEBUG: matrix-commander: Encryption is always enabled. It cannot be turned off.
2022-08-22 08:13:59,748: DEBUG: matrix-commander: All arguments are valid. All checks passed.
2022-08-22 08:13:59,748: DEBUG: matrix-commander: Trying to create a PID file to store process id 111265.
2022-08-22 08:13:59,748: DEBUG: matrix-commander: Successfully created PID file "/home/mbess/.run/matrix-commander.f8205c61-9a42-4277-af59-dd043998d100.pid" to store process id 111265.
2022-08-22 08:13:59,748: DEBUG: matrix-commander: Stdin pipe is assigned to "none".
2022-08-22 08:13:59,748: DEBUG: matrix-commander: SSL will be used. Default SSL certificate validation will be done for this connection.
2022-08-22 08:13:59,749: DEBUG: matrix-commander: Credentials file existed. So this is the one we suggest to use. file: credentials.json
2022-08-22 08:13:59,749: DEBUG: matrix-commander: Found an existing store in directory "store" (local or arguments). It will be used.
2022-08-22 08:14:01,209: DEBUG: matrix-commander: Logged in using stored credentials from credentials file "credentials.json".
2022-08-22 08:14:01,492: DEBUG: matrix-commander: restore_login successful. Successfully logged in as user @lefuturiste:matrix.org via restore_login. Response is: WhoamiResponse(uuid='', start_time=None, end_time=None, timeout=0, transport_response=

, user_id='@lefuturiste:matrix.org')

2022-08-22 08:14:01,494: DEBUG: matrix-commander: Room(s) from --room: ['!REDACTED:matrix.org']
2022-08-22 08:14:01,495: DEBUG: matrix-commander: Room(s) from --user: [], no users were specified.
2022-08-22 08:14:01,495: DEBUG: matrix-commander: Room(s) or user(s) were provided via command line. Overwriting room id from credentials file with rooms "['!REDACTED:matrix.org']" from command line.
2022-08-22 08:14:01,495: DEBUG: matrix-commander: Rooms are: ['!REDACTED:matrix.org']
2022-08-22 08:15:37,089: DEBUG: matrix-commander: stdin is not ready. A pipe could be used, but pipe could be empty, stdin could also be a keyboard.
2022-08-22 08:15:37,089: DEBUG: matrix-commander: Don't read from keyboard because there are messages provided in arguments with -m.
2022-08-22 08:15:37,089: DEBUG: matrix-commander: Messages from pipe: []
2022-08-22 08:15:37,089: DEBUG: matrix-commander: Messages from keyboard: []
2022-08-22 08:15:37,089: DEBUG: matrix-commander: Messages from command-line: ['wtf is this taking too much time']
2022-08-22 08:15:37,089: DEBUG: matrix-commander: Sending message in format "text".
2022-08-22 08:15:39,474: INFO: matrix-commander: This message was sent: "wtf is this taking too much time" to room "!REDACTED:matrix.org" as event "$DpMRKdtweZKUlplW4QuDz_ZHrTQSboL4320NsMCyQ4Q".
2022-08-22 08:15:39,474: DEBUG: matrix-commander: This message was sent: "wtf is this taking too much time" to room "!REDACTED:matrix.org". Response: event_id=$DpMRKdtweZKUlplW4QuDz_ZHrTQSboL4XXXXXXXXXXX, room_id=!REDACTED:matrix.org, full response: RoomSendResponse(uuid='', start_time=None, end_time=None, timeout=0, transport_response=

, event_id='$DpMRKdtweZKUlplW4QuDz_ZHrTQSboL4320XXXXXXXX', room_id='!REDACTED:matrix.org').
2022-08-22 08:15:39,474: DEBUG: matrix-commander: Message send action finished.
2022-08-22 08:15:39,475: DEBUG: matrix-commander: The program matrix-commander.py left the event loop.
2022-08-22 08:15:39,475: DEBUG: matrix-commander: Cleanup: cleaning up.

________________________________________________________
Executed in 100.81 secs fish external
usr time 67.04 secs 1.70 millis 67.04 secs
sys time 1.05 secs 0.15 millis 1.05 secs
```

However this is taking 67 secs! for a single message? Where it did go all wrong?
It's seems to be waiting for some thing between
`2022-08-22 08:14:01,495: DEBUG: matrix-commander: Rooms are: ['!REDACTED:matrix.org']`
and
`2022-08-22 08:15:37,089: DEBUG: matrix-commander: stdin is not ready. A pipe could be used, but pipe could be empty, stdin could also be a keyboard.`

My environnement:
- Matrix commander Git cloned 88cb0e4fc33fdc365ff950243011ca6b0e71b58c (I also tried using the version on pypip.org but no success)
- Python 3.10.5
- Linux 5.15.60.1-lts x86_64

Anyway thanks for your work

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

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

The debug log shows a long delay between room selection and stdin check. Look at the main entry point in matrix-commander.py, focusing on the sync loop or any blocking calls after login. Check if there's a sync operation that runs before sending messages. The issue is about performance, so profile the code between those timestamps to identify the bottleneck.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
cli
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

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

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