Hi, Mirek! It's to hard to say something, because heaven knows what does `codex2020` look like (is there any outgoing db-connections/url-requests/sub processes) and what is the DB where the scheduler is mounted (Postgres?). Exclusion method is universal - just make workers to dig something like Fibonacci numbers from fence to lunch with smoke breaks for a minute - if they will done the work then scheduler is OK
On Wednesday, August 16, 2017 at 6:32:12 PM UTC+3, Mirek Zvolský wrote: > > I have a task about 15 minutes long which run great on localhost with > command > python web2py.py -a "q" -K codex2020 -X > > In production, Debian9+systemd+nginx+uwsgi I have > - emperor.uwsgi.service for web server, > - web2py-scheduler.service for tasks, where > ExecStart=/usr/bin/python /home/www-data/web2py/web2py.py -K > codex2020,codex2020,codex2020 > > Task starts well, but after about 4 mins > - workers are restarted (they have later different job id's), > - scheduler_task has 1 RUNNING record > - scheduler_run has 2 RUNNING records, first one with earlier worker, > second one with (new) restarted worker. > There is no information (traceback or so) in the records, and all records > stay as RUNNING. > > The task is repeated from beginning. > I have found this is (I think) because the systemd service restarts the > task after the crash. > > So when I run without the systemd service, just with the shell command > nohup /usr/bin/python /home/www-data/web2py/web2py.py -K > codex2020,codex2020,codex2020 & > then the 2nd record in scheduler_run is not created and the task stops. > > Both records in scheduler_task and scheduler_run stay as RUNNING without > any crash info (no traceback, times_failed=0,..). > "jobs" command output before and after the crash is: > jobs > [1]+ Running nohup /usr/bin/python > /home/www-data/web2py/web2py.py -K codex2020,codex2020,codex2020 & > root@mzDebian:/# jobs > [1]+ Done nohup /usr/bin/python > /home/www-data/web2py/web2py.py -K codex2020,codex2020,codex2020 > > I show the postgres db content using DBeaver manager and after the task > crash I MUST RECONNECT. THE CONNECTION HANGS. > So maybe it has nothing to do with web2py/scheduler. > > Any idea what could I try? > Thanks, Mi > -- 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.