{"action":"closed","issue":{"url":"https://api.github.com/repos/web2py/web2py/issues/733","labels_url":"https://api.github.com/repos/web2py/web2py/issues/733/labels{/name}","comments_url":"https://api.github.com/repos/web2py/web2py/issues/733/comments","events_url":"https://api.github.com/repos/web2py/web2py/issues/733/events","html_url":"https://github.com/web2py/web2py/issues/733","id":55538091,"number":733,"title":"web2py DAL bug: OperationalError - MySQL server has gone away while closing a connection in pool","user":{"login":"niphlod","id":122119,"avatar_url":"https://avatars.githubusercontent.com/u/122119?v=3","gravatar_id":"","url":"https://api.github.com/users/niphlod","html_url":"https://github.com/niphlod","followers_url":"https://api.github.com/users/niphlod/followers","following_url":"https://api.github.com/users/niphlod/following{/other_user}","gists_url":"https://api.github.com/users/niphlod/gists{/gist_id}","starred_url":"https://api.github.com/users/niphlod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niphlod/subscriptions","organizations_url":"https://api.github.com/users/niphlod/orgs","repos_url":"https://api.github.com/users/niphlod/repos","events_url":"https://api.github.com/users/niphlod/events{/privacy}","received_events_url":"https://api.github.com/users/niphlod/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/web2py/web2py/labels/1%20star","name":"1 star","color":"FFFFFF"},{"url":"https://api.github.com/repos/web2py/web2py/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/web2py/web2py/labels/DAL","name":"DAL","color":"d4c5f9"},{"url":"https://api.github.com/repos/web2py/web2py/labels/imported","name":"imported","color":"FFFFFF"},{"url":"https://api.github.com/repos/web2py/web2py/labels/Priority-Medium","name":"Priority-Medium","color":"FFFFFF"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-26T21:11:31Z","updated_at":"2015-03-03T19:31:28Z","closed_at":"2015-03-03T19:31:28Z","body":"_From [Babu.Ann..._at_gmail.com](https://code.google.com/u/117901553787749562675/) on October 10, 2014 06:54:02_\n\nEnvironment: Ubuntu 12.04; Web2py 2.9.11-stable\r\n\r\nLet me describe the problem as below:\r\n\r\n- We use 2 DAL instance talking to 2 different databases, each with a connection pool of 10\r\n- We make many frequent DAL calls using both the DAL connections which results in many objects in the connection pool\r\n- At some point, web2py starts throwing an OperationalError with MySQL server has gone away when closing a connection. The stack trace is as below:\r\n\r\nS'Traceback (most recent call last):\\n  File “.../app/gluon/main.py\", line 543, in wsgibase\\n    BaseAdapter.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\\n    getattr(self, action)()\\n  File “…/app/gluon/dal.py\", line 1922, in rollback\\n    return self.connection.rollback()\\nOperationalError: (2006, \\'MySQL server has gone away\\')\\n'\r\n\r\nThis made the whole app very unstable with error tickets occurring almost for every action. \r\n\r\nWe 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:\r\n\r\n\\# added this to line 611 in dal.py\r\ntry:\r\n    db._adapter.close(action)\r\nexcept:\r\n    pass\r\n\r\n\r\nNote that, this error is reproducible in older versions of web2py as well.\r\n\r\nI would like to bring this forward to the group for further action on the same.\n\n_Original issue: http://code.google.com/p/web2py/issues/detail?id=1995_"}}