I have been getting Broken Pipe issues with pymysql:
Traceback (most recent call last):
  File "/home/web2py/gluon/main.py", line 470, in wsgibase
    BaseAdapter.close_all_instances('commit')
  File "/home/web2py/gluon/dal.py", line 272, in close_all_instances
    getattr(instance,action)()
  File "/home/web2py/gluon/dal.py", line 1036, in commit
    return self.connection.commit()
  File "/home/web2py/gluon/contrib/pymysql/connections.py", line 562, in 
commit
    self.errorhandler(None, exc, value)
  File "/home/web2py/gluon/contrib/pymysql/connections.py", line 182, in 
defaulterrorhandler
    raise Error(errorclass, errorvalue)
Error: (<class 'socket.error'>, error(32, 'Broken pipe'))

Everything is fine if I refresh the page, which I guess means that we 
establish a fresh MySQL connection rather than trying to reuse an old one 
(This is a quiet site)....however tracebacks are horrible for users to face, 
so this really needs fixing.

I guess this has been happening ever since the move to pymysql, but I've not 
had production sites using it & generally my development is done on sqlite, 
so I hadn't noticed.
This is with pool_size = 30 & a default MySQL Debian Squeeze install.

I see someone else has experienced it occasionally:
https://groups.google.com/forum/?pli=1#!searchin/web2py/Broken$20pipe$20pymysql/web2py/W8xs1Vx38jo/Hz-BeQyMhfgJ

I suspect that this would best be fixed in pymysql, but we should at least 
be catching in web2py anyway.

I'm tempted by the same request as this user:
https://groups.google.com/d/msg/web2py/GXyyuBdrtyg/up0eZ1nkpQYJ
Portability of pymysql is kinda nice, but it's really no big deal to install 
the proven MySQLdb.

Many thanks,
Fran.

Reply via email to