[web2py] Re: web2py DAL bug: OperationalError - MySQL server has gone away while closing a connection in pool

2014-10-09 Thread Massimo Di Pierro
Can you please open a ticket about this?

On Thursday, 9 October 2014 23:15:14 UTC-5, Babu Annamalai wrote:

 Environment: Ubuntu 12.04; Web2py 2.9.11-stable

 Let me describe the problem as below:


- We use 2 DAL instance talking to 2 different databases, each with a 
connection pool of 10
- We make many frequent DAL calls using both the DAL connections which 
results in many objects in the connection pool
- At some point, web2py starts throwing an OperationalError with MySQL 
server has gone away when closing a connection. The stack trace is as 
 below:

 S'Traceback (most recent call last):\n  File “.../app/gluon/main.py, line 
 543, in wsgibase\nBaseAdapter.close_all_instances(\'rollback\')\n  File 
 “.../app/gluon/dal.py, line 611, in close_all_instances\n
 db._adapter.close(action)\n  File “.../app/gluon/dal.py, line 591, in 
 close\ngetattr(self, action)()\n  File “…/app/gluon/dal.py, line 1922, 
 in rollback\nreturn self.connection.rollback()\nOperationalError: 
 (2006, \'MySQL server has gone away\')\n'

 This made the whole app very unstable with error tickets occurring almost 
 for every action. 

 We had tried wrapping all our DAL calls with exception handlers for this 
 error but we were unable to get this sorted. Eventually, the only way I 
 could fix this is to put an exception handler around the code block which 
 is throwing the error as below:
 # added this to line 611 in dal.py
 try:
 db._adapter.close(action)
 except:
 pass


 Note that, this error is reproducible in older versions of web2py as well.

 I would like to bring this forward to the group for further action on the 
 same.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py DAL bug: OperationalError - MySQL server has gone away while closing a connection in pool

2014-10-09 Thread Babu Annamalai
Thanks for the reply Massimo. Raised a new ticket Issue 1995 
https://code.google.com/p/web2py/issues/detail?id=1995.

On Friday, October 10, 2014 10:14:31 AM UTC+5:30, Massimo Di Pierro wrote:

 Can you please open a ticket about this?

 On Thursday, 9 October 2014 23:15:14 UTC-5, Babu Annamalai wrote:

 Environment: Ubuntu 12.04; Web2py 2.9.11-stable

 Let me describe the problem as below:


- We use 2 DAL instance talking to 2 different databases, each with a 
connection pool of 10
- We make many frequent DAL calls using both the DAL connections 
which results in many objects in the connection pool
- At some point, web2py starts throwing an OperationalError with 
MySQL server has gone away when closing a connection. The stack trace is 
 as 
below:

 S'Traceback (most recent call last):\n  File “.../app/gluon/main.py, 
 line 543, in wsgibase\nBaseAdapter.close_all_instances(\'rollback\')\n  
 File “.../app/gluon/dal.py, line 611, in close_all_instances\n
 db._adapter.close(action)\n  File “.../app/gluon/dal.py, line 591, in 
 close\ngetattr(self, action)()\n  File “…/app/gluon/dal.py, line 1922, 
 in rollback\nreturn self.connection.rollback()\nOperationalError: 
 (2006, \'MySQL server has gone away\')\n'

 This made the whole app very unstable with error tickets occurring almost 
 for every action. 

 We had tried wrapping all our DAL calls with exception handlers for this 
 error but we were unable to get this sorted. Eventually, the only way I 
 could fix this is to put an exception handler around the code block which 
 is throwing the error as below:
 # added this to line 611 in dal.py
 try:
 db._adapter.close(action)
 except:
 pass


 Note that, this error is reproducible in older versions of web2py as well.

 I would like to bring this forward to the group for further action on the 
 same.



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.