Design - HenryHu/pybbs Wiki

Design Problems

Currently, the system is multi-threaded. Since there is no synchronization, there are many problems here.

Problems

notify error: unsupported-stanza-type "presence"

Notify thread accessed a ServerCore which has not been initialized.

roster.updater exception: dictionary changed size during iteration

Updater thread was iterating on the rosters._rosters, while a user logged in/logged out, changes rosters._rosters

Solution

Either: 1. Add synchronization 2. Restore single-threaded design

Add synchronization

Care: deadlock

single-threaded design

Allow delegated method execution: still requires synchronization Remove other threads: how to inject timeout events?

Unrecognized Stanza "presence" in xmppstream.py:start()

Reason unknown. "presence" tag in wrong order?