#celery

/

      • emperorcezar has quit
      • asksol_
        ffffffffffffffff: you just need to specify the correct app...
      • jeffasinger has quit
      • 44UAAAAHL: what signal?
      • jeffasinger joined the channel
      • anuvrat joined the channel
      • aljohri joined the channel
      • johnraz is now known as johnraz|away
      • pfreixes has quit
      • travis-ci joined the channel
      • travis-ci
        [travis-ci] celery/celery#1975 (master - 2d7904a : Ask Solem): The build was fixed.
      • travis-ci has left the channel
      • the_rat joined the channel
      • johnraz|away is now known as johnraz
      • anuvrat has quit
      • bmbouter_afk is now known as bmbouter
      • vpol joined the channel
      • bmbouter
        asksol_ rabbitMQ clients may not be able to reconnect, but qpid clients can
      • that is going to be a sweet feature for the qpid transport
      • asksol_
        so it will redeclare the queue if the connection is lost?
      • bmbouter
        either that, or queues that start with the celery event queue prefix will force durable=True within Channel.basic_consume
      • reconnect works perfectly with that set
      • asksol_
        the transport shouldn't treat queues specially based on name, it should be decoupled from the application
      • and how about QoS limits? does it re-enable them?
      • bmbouter
        actually the QoS limits need some work anyway, so I'll have to give that some thought
      • asksol_
        kombu expects the transport to propagate errors so that the caller can reconnect
      • ffffffffffffffff has left the channel
      • it's not only the events queue, it's also publishing to any non-durable queue
      • that's why we have Producer.publish(..., rertry=True, declare=entitites)
      • bmbouter
        where is that call in the code? I'd like to read around it
      • kashnikov joined the channel
      • boris317_ joined the channel
      • boris317 has quit
      • from what you are telling me, using retry=True and declare=entities would provide auto-reconnect functionality
      • dgel joined the channel
      • anuvrat joined the channel
      • asksol_
        the transport doesn't reconnect, the Producer.publish operation does
      • and the user may have to do so manually if different steps are required
      • bmbouter
        so that may handle publishes that would fail because of a failed connection
      • but what about consumers
      • for instance if I start a single celery worker and connect it to rabbitmq
      • then I stop rabbitmq
      • I get this traceback
      • I expected that the error would propogate through kombu to celery and celery would wait and retry
      • 44UAAAAHL has quit
      • asksol_
        the worker restarts the Consumer blueprint when it sees Connection.recoverable_connection_errors
      • anuvrat has quit
      • if the error is not in there, it will crash
      • bmbouter
        why for rabbitMQ wouldn't the error experienced when rabbitMQ shuts down, but celery doesn't not be in recoverable_connection_errors?
      • basically, if the broker shuts down, celery should just wait
      • maybe not as default, but at least as an optional feature
      • asksol_
        that's exactly what it does, it will continue retrying forever
      • bmbouter
        so then why does my worker exit and give the stack trace above when rabbitMQ shuts down?
      • with rabbitmq
      • asksol_
        I would guess SystemError is not a recoverable connection error, and that you have an old version of librabbitmq perhaps
      • bmbouter
        librabbitmq==1.5.0
      • so you're saying this is not the expected behavior
      • asksol_
        it's the expected behavior if a SystemError is raised
      • bmbouter
        oh wait, there is more to the stack trace
      • here is the full one
      • asksol_
        for unexpected errors it's better to crash so that operators can be notified
      • bmbouter
        that is not always true, in our case we want celery workers to just keep on going if the broker bounces
      • surabujin has quit
      • monitoring is another component's responsibility, watching celery run should not be the monitoring point of broker availability
      • asksol_
        right, but you need to map out the errors
      • bmbouter
        agreed, "all errors" should not be treated this way
      • I'll have to map them for qpid.messaging as a client
      • asksol_
        I'm saying unexpected errors, a broker connection error is not unexpected
      • bmbouter
        oh ok
      • well then we agree perfectly I think
      • asksol_
        try upgrading to the latest librabbitmq, it's probably fixed
      • bmbouter
        so back to this stack trace with rabbitMQ, Celery observes ""Connection to broker lost Trying to re-establish" and then another ConnectionErorr is raised
      • ok upgrading now...
      • asksol_
        it would never have been able to recover from this error, so in that case it would just never recover even if the broker does
      • bmbouter
        right because it's an acutual correctness problem you are saying
      • with librabbitmq
      • asksol_
        it's a programming error in librabbitmq, like a SyntaxError they are not treated as a connection error
      • bmbouter
        right
      • got it
      • asksol_
        unless the transport adds SyntaxError to the list of recoverable connection errors :)
      • bmbouter
        so how can I have my Qpid transport for kombu indicate the recoverable error set?
      • hahaha
      • no no, we're not doing that :-)
      • asksol_
        before it was Transport.connection_errors and Transport.channel_errors
      • both would cause the connection to be reestablished
      • anuvrat joined the channel
      • bmbouter
        are those still respected?
      • you say "before..."
      • asksol_
        now it's recoverable_connection_errrors and recoverable_channel_errors
      • bmbouter
        oh ok
      • asksol_
        they are used if the new ones are not defined
      • bmbouter
        are these used by kombu or celery?
      • it sounds like celery
      • because celery is decided if it needs to re-enter or not
      • asksol_
        recoverable_channel_errors will close and recreate the channel, recoverable_connection_errors will reestablish the connection
      • if you only have connections you can just define the latter
      • mahmoudimus joined the channel
      • it's used by both kombu and celery, usually you will not use them directly but use the Connection.ensure and Connection.autoretry wrappers
      • and some of the operations support the retry argument (like Producer.publish)
      • jergerber has quit
      • def b(channel): consumer = Consumer(channel, [queue]); consumer.qos(prefetch_count=10); ...,
      • bmbouter
        so upgrading to librabbitmq==1.5.2 caused the behavior with rabbitMQ to be really reliable
      • asksol_
        Connection.autoretry(b)()
      • autoretry for functions taking a channel argument, ensure for objects having a channel attribute
      • bmbouter
        asksol_ cool
      • asksol_
        so you are defining transaction points kinda
      • bmbouter
        is there anywhere in the celery docs that talks about celery's reconnect bahavior for users?
      • asksol_
        reminds me how cool would it be if the with statement could reexecute the block
      • bmbouter
        we could make a modified ContextManager
      • that supported re-entry
      • mahmoudimus has quit
      • asksol_
      • kombu docs have been on my todo for years
      • bmbouter
        could you show me where you would want this?
      • asksol_
        I don't think there is any way to re-execute the with statement block
      • unless you do some AST hacking maybe
      • there should be a error recover section in the kombu userguide, but not yet written
      • bmbouter
        I may writ eit
      • write it
      • asksol_
        an error recovery section
      • that would be awesome!
      • the retry policy described in the celery calling guide is the same in kombu
      • there are also some best practices that are not described anywhere
      • like always passing connections instead of channels
      • e.g. x = Producer(connection.channel()); x.publish(retry=True) won't work unless the connection is already established
      • x = Producer(connection).publish(retry=True) will work and uses the connections default channel, since producer treats the channel lazily
      • brb, must get food
      • anuvrat has quit
      • georgeirwin has quit
      • georgeirwin joined the channel
      • georgeir_ joined the channel
      • johnraz is now known as johnraz|away
      • georgeirwin has quit
      • edulix has quit
      • edulix joined the channel
      • bmbouter
        asksol_ I will try to include those things in my first pass at this
      • bkuberek_ joined the channel
      • anuvrat joined the channel
      • bkuberek has quit
      • frgtn has quit
      • pfreixes joined the channel
      • ELFrederich has quit
      • anuvrat has quit
      • johnraz|away is now known as johnraz
      • brockhaywood has quit
      • anuvrat joined the channel