Patches item #1158052, was opened at 2005-03-07 03:28 Message generated for change (Comment added) made by vsajip You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1158052&group_id=5470
Category: Library (Lib) Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Sebastian Prause (sprause) >Assigned to: Vinay Sajip (vsajip) Summary: fix for a deadlock in the logging module Initial Comment: there is a deadlock in the logging package, that can be triggered with a custom class importer: (1) create a custom class importer and put it in sys.meta_path (this importer must log a message via the logging package) (2) raise an exception somewhere and log it (3) when the formatter tries to format the exception, it imports the traceback module (in the formatException method) (4) this import will be redirected to the above installed class importer (5) the class importer tries to log a message (6) trying to acquire the lock for the new log message in Handler.acquire results in a deadlock the fix is to move the traceback import from the method to the module, so it gets imported when no lock is held. the attached patch does this ---------------------------------------------------------------------- >Comment By: Vinay Sajip (vsajip) Date: 2005-03-13 09:59 Message: Logged In: YES user_id=308438 Fix checked into CVS, thanks. ---------------------------------------------------------------------- Comment By: Sebastian Prause (sprause) Date: 2005-03-07 21:47 Message: Logged In: YES user_id=925608 SMTPHandler and HTTPHandler have the same problem, as they import modules in the emit() method... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1158052&group_id=5470 _______________________________________________ Patches mailing list [email protected] http://mail.python.org/mailman/listinfo/patches
