Opened 5 months ago

Closed 5 months ago

#35496 closed Bug (invalid)

ASGI Connection Leakage during Exception Logging

Reported by: mietma Owned by:
Component: Error reporting Version: 4.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Mariusz Felisiak)

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

Change History (1)

comment:1 by Mariusz Felisiak, 5 months ago

Description: modified (diff)
Resolution: invalid
Status: newclosed

Thanks for the ticket, however it's a support question and Trac is not a support channel, check out TicketClosingReasons/UseSupportChannels.

Note: See TracTickets for help on using tickets.
Back to Top