Open Beneter opened 4 years ago
Reading that bug notes that PyMySQL is not thread safe. I'm a bit surprised that this hasn't popped up more on production, but good info none the less. Thanks!
Reading that bug notes that PyMySQL is not thread safe.
IIRC, SQLAlchemy is supposed to have some logic to help deal with this, by using the connectionpool to ensure only one thread is dealing with a connection at any one time. It's possible we're doing something wrong in that regard though.
So thanks to #202 I was able to reconfigure the sqluri to mysql+mysqldb://firefox-sync:password@localhost/firefox_sync
and after installing ./local/bin/pip install mysqlclient
I was finally able to start the syncserver. It might be helpful to add this option to the Readme.md.
When running
make serve
on the latest master version 7557f7f06cf175537e639dd3ae16d137c70c5905 with the configuration optionsqluri = pymysql://firefox-sync:password@localhost/firefox_sync
I get the following exception:InternalError: (pymysql.err.InternalError) Packet sequence number wrong - got 1 expected 0
Traceback.txtI triple checked my connection string and the MySQL permissions. According to https://github.com/PyMySQL/PyMySQL/issues/422 this might be caused by multithreading.