I switched to using pip for building uwsgi and now @timer is firing.
When I use @timer, reloads and SIGINT are handled promptly. So that is my
problem solved.


However if I use @rbtimer I still get the behaviour where the the reload
and SIGINT seem to have to wait until after the timer has expired before
being handled. Here is the config:

[uwsgi]
master = true
processes = 1
threads = 4
virtualenv = /home/richardc/business/therivermouth/ttt/v
pythonpath = /home/richardc/business/therivermouth/ttt/v
touch-reload = /home/richardc/business/therivermouth/ttt/v
module = hello
callable = app
socket = 127.0.0.1:7000
catch-exceptions = true

Here is the minimal python code:

from flask import Flask
from uwsgidecorators import *

app = Flask(__name__)

@rbtimer(30)
def ttt(num):
    print 'timer'


@app.route("/")
def hello():
    return "hellooo"



Richard Collins
http://richardc.net


On 1 November 2013 21:45, Roberto De Ioris <[email protected]> wrote:

>
> > Hi,
> >
> > I'm running uwsgi 1.9.17.1 on Ubuntu 12.04 and a Python Flask app. I'm
> > having trouble with uwsgi timers.
> >
> > First problem @timer decorator does not work at all for me. However if I
> > switch to @rbtimer, I get a working timer.
> >
> > Secondly, @rbtimer interacts with reloading of uwsgi.  When I hit Ctrl-C,
> > uwsgi seems to have to wait for the timer to expire before it can 'bury
> > the
> > workers'. I can hit Ctrl-C a second timer to force quit. I get the same
> > behaviour with touch-reload, after a file is touched uwsgi seems to have
> > to
> > wait until the timer expires.
> >
> > Are these known behaviours, are there any workarounds?
>
> Absolutely not, expecially for the @timer part, it requires kernel
> cooperation with timerfd(), something ubuntu 12.04 definetely support.
>
> can you paste your config and the function attached to the timer ?
>
> >
> >
> > Also any suggestions on the best way to track the latest stable release
> on
> > Precise would be helpful. There are a few PPAs on Launchpad on 1.9, I
> > picked one at random.
> >
>
> there are currently dozens of debian/ubuntu (modern) packages available
> with different approaches based on different needs. Honestly i do not know
> which one to follow (but be sure to not use anything older than 1.4), but
> i strongly suggest you to build from official sources (expecially if we
> need to investigate some kind of bugs)
>
> Building uWSGI is not annoying as the vast majority of C projects, you do
> not not need autotools or particular make-suite versions. Only python and
> gcc, and the build procedure should not take more than 20 seconds.
>
> Another approach (if you are using python) is simply running
>
> pip install uwsgi
>
> you will always get the latest version in a monolythic binary with the
> python (or pypy) plugin embedded
>
> --
> Roberto De Ioris
> http://unbit.it
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to