I'm really not sure on how to tackle this mysql-specific shortcoming but I 
get the point. 
What does happen if you queue the task with sync_output=200 ? Functionaly 
you don't need it, but practically - but still in theory - it would 
short-circuit the issue keeping the connection alive every 200 seconds ...

On Monday, June 6, 2016 at 1:29:04 PM UTC+2, Andre Kozaczka wrote:
>
> In the "real" world, the task can take anywhere from 1 minute up to 30 
> minutes.
>
> In debugging my problem, I created a dummy task that would loop (sleep 15 
> seconds then do a db write) and end after a set period of time. I'm seeing 
> the problem when the dummy task takes over 300 seconds - anything less that 
> that the scheduler is able to update the task status after completion with 
> no errors.
>
> On Monday, June 6, 2016 at 6:31:40 AM UTC-4, Niphlod wrote:
>
>> how many seconds does it take to be executed ?
>>
>> On Monday, June 6, 2016 at 3:46:12 AM UTC+2, Andre Kozaczka wrote:
>>>
>>> I'm getting the following error after my scheduled task completes:
>>>
>>>
>>> Traceback (most recent call last): File 
>>> "/home/wdis/web2py/gluon/shell.py", line 273, in 
>>>    run exec(python_code, _env) 
>>> File "<string>", line 1, in <module> 
>>> File "/home/wdis/web2py/gluon/scheduler.py", line 717, in loop 
>>>    self.wrapped_report_task(task, self.async(task)) 
>>> File "/home/wdis/web2py/gluon/scheduler.py", line 874, in 
>>> wrapped_report_task 
>>>    db.rollback() 
>>> File "/home/wdis/web2py/gluon/packages/dal/pydal/base.py", line 956, in 
>>> rollback 
>>>    self._adapter.rollback() 
>>> File "/home/wdis/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
>>> 1342, in rollback return self.connection.rollback()
>>> OperationalError: (2006, 'MySQL server has gone away')
>>>
>>>
>>>
>>> It appears that the db connection created by the scheduler (to update 
>>> the task status) gets stale and MySQL is closing it. I've tried adding 
>>> dummy reads to the database in my scheduled task code but it seems to have 
>>> no bearing on the db connection used by the scheduler.
>>>
>>> Any advice? I'm using PythonAnywhere so I can not change the timeout 
>>> setting for MySQL.
>>>
>>> -Andre
>>>
>>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to