#35496: ASGI Connection Leakage during Exception Logging
---------------------------------+--------------------------------------
     Reporter:  mietma           |                    Owner:  (none)
         Type:  Bug              |                   Status:  closed
    Component:  Error reporting  |                  Version:  4.2
     Severity:  Normal           |               Resolution:  invalid
     Keywords:                   |             Triage Stage:  Unreviewed
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

 * resolution:   => invalid
 * status:  new => closed


Old description:

> Hi,
>
> I am having trouble with Django ASGI leaving idle connections if
> exceptions are thrown. I narrowed it down to the logging of the
> exceptions.
> The 'ExceptionReporter' opens new connections during the
> 'get_traceback_text()' method, which are then not closed.
> I made a workaround by implementing a custom ExceptionReporter which
> closes connections afterwards.
>
> class CustomExceptionReporter(ExceptionReporter):
>     def get_traceback_text(self):
>         res = super().get_traceback_text()
>         close_old_connections()
>         return res
>
> Is my approach correct or am I destroying something else?
>
> Best regards,
> Matthias

New description:

 Hi,

 I am having trouble with Django ASGI leaving idle connections if
 exceptions are thrown. I narrowed it down to the logging of the
 exceptions.
 The 'ExceptionReporter' opens new connections during the
 'get_traceback_text()' method, which are then not closed.
 I made a workaround by implementing a custom ExceptionReporter which
 closes connections afterwards.

 {{{
 class CustomExceptionReporter(ExceptionReporter):
     def get_traceback_text(self):
         res = super().get_traceback_text()
         close_old_connections()
         return res
 }}}

 Is my approach correct or am I destroying something else?

 Best regards,
 Matthias

--
Comment:

 Thanks for the ticket, however it's a support question and Trac is not a
 support channel, check out TicketClosingReasons/UseSupportChannels.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35496#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018fe7f72ad7-4f01ab88-7a2d-45a8-9926-5cbaad3e651b-000000%40eu-central-1.amazonses.com.

Reply via email to