Skip to content
This repository was archived by the owner on Mar 19, 2019. It is now read-only.
This repository was archived by the owner on Mar 19, 2019. It is now read-only.

usage of AsyncResult in MatrixTransport is broken #132

@schmir

Description

@schmir

MatrixTransport.do_reconnect is an gevent AsyncResult that's being created in MatrixTransport.__init__.

It's being set in the matrix_exception_handler method, which is being called, when an exception happened.

The _run method waits for self.do_reconnect to be set in a loop. The problem is that only the first time it will wait on self.do_reconnect. In later iterations the self.do_reconnect is already set and it looks like that is not what was intended here.

It looks like a gevent.event.Event instance should be used instead, since that one could be reset/cleared.

Also the usage of magic constants like 100 could be improved (i.e. don't use magic constants).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions