Enhancement: Matrix commander is slow, it seems to temporarily hang due to syncing
- Lenguaje dominante
- Python
- Estrellas
- 754
- Forks
- 69
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- cli
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 45/100