Twisted, MySQLdb and (2006, 'MySQL server has gone away') using Twisted adbapi
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In twisted I am a perpetual event loop that is always lookig for a new query to run It polls a SQS queue and are are times where time between queres is long enough to time out and this is the error I get when a new query arrives... MySQLdb _mysql_exceptions.OperationalError: (2006, 'MySQL server has gone away') here is my connection self.pool = adbapi.ConnectionPool("MySQLdb", self.parms['host'], self.parms['username'], self.parms['password'], self.parms['database']) Here is the logic I use to try and solve the problem. try: d = self.pool