So, I added: logger.debug('is_a_ticker := %s, worker_status[0] := %s',
self.is_a_ticker, self.worker_status[0]) before the last if of relevant
snippet you posted,logs:

2013-03-27 13:25:01,785 - web2py.scheduler.mapserver#29806 - INFO - TICKER:
I'm a ticker
2013-03-27 13:25:01,797 - web2py.scheduler.mapserver#29806 - DEBUG -
looping...
2013-03-27 13:25:01,798 - web2py.scheduler.mapserver#29806 - INFO - pop
task True False
2013-03-27 13:25:01,950 - web2py.scheduler.mapserver#29806 - DEBUG -
is_a_ticker := True, worker_status[0] := ACTIVE
2013-03-27 13:25:01,978 - web2py.scheduler.mapserver#29806 - INFO - nothing
to do

I supposed to see "is_a_ticker := True, worker_status[0] := ACTIVE" after
"INFO - TICKER: I'm a ticker" and then something like:  'DEBUG - Assigning
tasks..' but I didn't see it because I have 'INFO - pop task True False',
the last False, means that self.do_assign_tasks was False. Later, the
worker_status[0]
is ACTIVE so it would set do_assign_tasks to True but it is too late.
Given that, in some cases pop_task comes before the do_assign_tasks = True
statement. This could be the problem, Is It correct?




 Paolo


2013/3/27 Niphlod <niph...@gmail.com>

> yeps.
> this is expected, but every ~15 seconds that turns to "True" (meaning more
> or less "I'm the Ticker, I'm free, I was free in the last 15 seconds, let's
> see if there are any submitted (or repeating) tasks to assign").
> I don't have a python interpreter ATM but let's break up the logic, so
> everyone can follow (and explaining most of the times lights up the
> underlying problem, let's hope so)
>
> Who "tells" if that process is a Ticker is the "being_a_ticker()" function.
> being_a_ticker() is wrapped in a try_except clause, so you should see the
> error logging in case something goes wrong --> Error coordinating TICKER
>
> one level up, do_assign_task is set every 5 cycles (or when "PICK" is
> found), with the "prune dead workers" logic in the same statements...that
> too is wrapped and should log --> Error cleaning up
>
> one level up, the whole thread checking is wrapped and should log -->
> Error retrieving status
>
> Now, you get "I'm a TICKER", so the being_a_ticker() is getting executed,
> and you don't have any errors reported...... this is the relevant snippet
>                     try:
>                         self.is_a_ticker = self.being_a_ticker()
>                     except:
>                         logger.error('Error coordinating TICKER')
>                     if self.worker_status[0] == ACTIVE:
>                         self.do_assign_tasks = True
>
> So...... either the worker status is not ACTIVE at that moment, or
> self.do_assign_task is set to True .....
>
>
>
>
>
>  --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/u_PgzKLuQmw/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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/groups/opt_out.


Reply via email to