Apscheduler listener issues

678 views
Skip to first unread message

Gayathri Venkataraman

unread,
May 5, 2014, 2:34:22 PM5/5/14
to apsch...@googlegroups.com
Hi 

I am using apscheduler version 2.1.1 backend mysql 5.5 with sqlalchemy 0.7.10 python version 2.6.6. and i am using django 1.5

Here is how my apscheduler is started

self.config={'standalone':False,'daemonic':False,'threadpool.max_threads':const.job_scheduler_max_threads,'threadpool.keepalive':const.job_scheduler_keep_alive}
        self.sched = Scheduler(self.config)
        
        self.context=context
        self.sched.add_jobstore(MySQLAlchemyJobStore(engine=_engine),'default')
        self.sched.start()
        self.sched.add_listener(self.job_error_listener,
                   events.EVENT_JOB_ERROR)
        self.sched.add_listener(self.job_success_listener,
                   events.EVENT_JOB_EXECUTED)
        self.sched.add_listener(self.job_missed_listener,
                   events.EVENT_JOB_MISSED)

So here i pass the same engine which created for the app. There are two issues that i am seeing
1. i have periodic health check job which runs every 5 mins. I also have on demand jobs that are scheduled on need basis. the listener listens to the success and failure of these events and update the db accordingly. The entities they update are different. I sometimes see when there is an error event on health check and there was also error event on the on-demand job, the listener on the demand job dies with no exception and nothing to trace...The callback of the error event for the jobs came and the health check listener successfully processed everything but the on demand job has no updates beyond a point, i am not able to see whether it died, there was an exception or it is stuck somewhere. SUbsquent jobs are going through fine...How to debug this issue or have you seen these issues before???

2. The second issue ...so when a job is executing, i do a service httpd stop and the application shuts down but the job is executed successfully, but there are no db updates for the success. So I do not see any debug statements for the listener events and this is the exception i see...are there are any none issues here

Does upgrading to 3.0.0 fix any of the above issues?

Thanks for helping 


[Tue Apr 29 05:31:03 2014] [notice] caught SIGTERM, shutting down
[Tue Apr 29 12:31:04 2014] [error] ('Port %s is a standard port', '80')

[Tue Apr 29 12:31:05 2014] [error] ('Port %s is a standard port', '80')

[Tue Apr 29 12:31:05 2014] [error] Exception in thread APScheduler:

[Tue Apr 29 12:31:05 2014] [error] Traceback (most recent call last):

[Tue Apr 29 12:31:05 2014] [error]   File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner

[Tue Apr 29 12:31:05 2014] [error]     self.run()

[Tue Apr 29 12:31:05 2014] [error]   File "/usr/lib64/python2.6/threading.py", line 484, in run

[Tue Apr 29 12:31:05 2014] [error]     self.__target(*self.__args, **self.__kwargs)

[Tue Apr 29 12:31:05 2014] [error]   File "/usr/lib/python2.6/site-packages/apscheduler/scheduler.py", line 581, in _main_loop

[Tue Apr 29 12:31:05 2014] [error]     next_wakeup_time = self._process_jobs(now)

[Tue Apr 29 12:31:05 2014] [error]   File "/usr/lib/python2.6/site-packages/apscheduler/scheduler.py", line 547, in _process_jobs

[Tue Apr 29 12:31:05 2014] [error]     self._threadpool.submit(self._run_job, job, run_times)

[Tue Apr 29 12:31:05 2014] [error]   File "/usr/lib/python2.6/site-packages/apscheduler/threadpool.py", line 102, in submit

Alex Grönholm

unread,
May 5, 2014, 6:58:07 PM5/5/14
to apsch...@googlegroups.com
05.05.2014 21:34, Gayathri Venkataraman kirjoitti:
Hi 

I am using apscheduler version 2.1.1 backend mysql 5.5 with sqlalchemy 0.7.10 python version 2.6.6. and i am using django 1.5

Here is how my apscheduler is started

self.config={'standalone':False,'daemonic':False,'threadpool.max_threads':const.job_scheduler_max_threads,'threadpool.keepalive':const.job_scheduler_keep_alive}
        self.sched = Scheduler(self.config)
        
        self.context=context
        self.sched.add_jobstore(MySQLAlchemyJobStore(engine=_engine),'default')
        self.sched.start()
        self.sched.add_listener(self.job_error_listener,
                   events.EVENT_JOB_ERROR)
        self.sched.add_listener(self.job_success_listener,
                   events.EVENT_JOB_EXECUTED)
        self.sched.add_listener(self.job_missed_listener,
                   events.EVENT_JOB_MISSED)

So here i pass the same engine which created for the app. There are two issues that i am seeing
1. i have periodic health check job which runs every 5 mins. I also have on demand jobs that are scheduled on need basis. the listener listens to the success and failure of these events and update the db accordingly. The entities they update are different. I sometimes see when there is an error event on health check and there was also error event on the on-demand job, the listener on the demand job dies with no exception and nothing to trace...The callback of the error event for the jobs came and the health check listener successfully processed everything but the on demand job has no updates beyond a point, i am not able to see whether it died, there was an exception or it is stuck somewhere. SUbsquent jobs are going through fine...How to debug this issue or have you seen these issues before???

2. The second issue ...so when a job is executing, i do a service httpd stop and the application shuts down but the job is executed successfully, but there are no db updates for the success. So I do not see any debug statements for the listener events and this is the exception i see...are there are any none issues here

Does upgrading to 3.0.0 fix any of the above issues?
I don't have enough information to figure out what the problem is that you're having.
No, I have not seen issues like you describe. Could you make a script I could use to reproduces these problems on my end?

Thanks for helping 


[Tue Apr 29 05:31:03 2014] [notice] caught SIGTERM, shutting down
[Tue Apr 29 12:31:04 2014] [error] ('Port %s is a standard port', '80')

[Tue Apr 29 12:31:05 2014] [error] ('Port %s is a standard port', '80')

[Tue Apr 29 12:31:05 2014] [error] Exception in thread APScheduler:

[Tue Apr 29 12:31:05 2014] [error] Traceback (most recent call last):

[Tue Apr 29 12:31:05 2014] [error]   File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner

[Tue Apr 29 12:31:05 2014] [error]     self.run()

[Tue Apr 29 12:31:05 2014] [error]   File "/usr/lib64/python2.6/threading.py", line 484, in run

[Tue Apr 29 12:31:05 2014] [error]     self.__target(*self.__args, **self.__kwargs)

[Tue Apr 29 12:31:05 2014] [error]   File "/usr/lib/python2.6/site-packages/apscheduler/scheduler.py", line 581, in _main_loop

[Tue Apr 29 12:31:05 2014] [error]     next_wakeup_time = self._process_jobs(now)

[Tue Apr 29 12:31:05 2014] [error]   File "/usr/lib/python2.6/site-packages/apscheduler/scheduler.py", line 547, in _process_jobs

[Tue Apr 29 12:31:05 2014] [error]     self._threadpool.submit(self._run_job, job, run_times)

[Tue Apr 29 12:31:05 2014] [error]   File "/usr/lib/python2.6/site-packages/apscheduler/threadpool.py", line 102, in submit

--
You received this message because you are subscribed to the Google Groups "APScheduler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apscheduler...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages