Re: [pylons-discuss] Is there a way to hook into the queue depth warning?

2021-05-21 Thread Michael Merickel
It's using the python stdlib logging library. You can add a handler to that 
logger that sends emails or does anything else. It really depends on how you're 
running your processes how to setup logging properly but in Pyramid (which uses 
logging.config.fileConfig) it would be done by adding another section to your 
ini file to catch the "waitress.queue" logger.

[loggers]
keys = ..., waitress_queue

[handlers]
keys = ..., waitress_queue

[logger_waitress_queue]
handlers = waitress_queue
qualname = waitress.queue

[handler_waitress_queue]
class = handlers.SMTPHandler
args = (('example.com', 578, 'f...@example.com', ['t...@example.com'], 'queue 
depth warning', ('username', 'password'))
formatter = generic

- Michael

> On May 21, 2021, at 15:51, jdavi...@gmail.com  wrote:
> 
> I understand the cause of the warning, I just wonder if there's a way to hook 
> into the process that triggers it to allow it to send a warning email or 
> something when the queue depth reaches a certain threshold? 
> 
> Alternatively is there a way to query it to see what the queue depth is 
> currently?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to pylons-discuss+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pylons-discuss/d65251f9-61b4-4551-9c3b-761c193074f8n%40googlegroups.com
>  
> .

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/0297A2C3-93D4-4389-B09E-0AE1C2D4DF5C%40gmail.com.


[pylons-discuss] Is there a way to hook into the queue depth warning?

2021-05-21 Thread jdavi...@gmail.com
I understand the cause of the warning, I just wonder if there's a way to 
hook into the process that triggers it to allow it to send a warning email 
or something when the queue depth reaches a certain threshold? 

Alternatively is there a way to query it to see what the queue depth is 
currently?

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/d65251f9-61b4-4551-9c3b-761c193074f8n%40googlegroups.com.


[pylons-discuss] debugtoolbar - don't intercept a raised exception ?

2021-05-21 Thread 'Jonathan Vanasco' via pylons-discuss
One of my CI tests deals with an edge case, in which a HTTPMovedPermanently 
is raised in deeply nested code. This almost never gets raised in 
Production - rules on the loadbalancer/gateway typically catch it.

With the debugtoolbar off, Pyramid serves the redirect.  With the 
debugtoolbar enabled, it's caught by toolbar.py as an Exception and never 
makes it to the block of code dealing with `intercept_redirects`.

Has anyone encountered this before and developed a good workaround?  I feel 
like this test used to pass, but I can't find anything on our change 
history or Pyramid/Debugtoolbar's that would cause this change.


-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/ea13f955-007b-403f-a009-1a4e7ac5d288n%40googlegroups.com.


[pylons-discuss] zodburi 2.5.0 released

2021-05-21 Thread Kirill Smelkov
Hello up there,

A new release of the package to convert URI into ZODB storage just came out.

The highlight of this release is added support for `demo:` URI resolver. For 
example

demo:(zeo://localhost:9001?storage=abc)/(file:///path/to/Changes.fs)

refers to DemoStorage that combines ZEO with local FileStorage for changes.

The other news in this release are:

* Support both ZODB4 and ZODB5.
* Add support for PyPy.
* Add support for Python 3.8.
* Drop support for Python 3.4.

Thanks to Tres Seaver, Bert JW Regeer, Steve Piercy, Éloi Rivard and Jason
Madden for their help for this release to happen.

Kirill



About zodburi:

Zodburi is a library which parses URIs and converts them to ZODB storage
objects and database arguments.

https://pypi.org/project/zodburi/
https://docs.pylonsproject.org/projects/zodburi/en/latest/
https://github.com/Pylons/zodburi

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/YKdpDcKSKA/dQgaQ%40deco.navytux.spb.ru.