[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-10-09 Thread Vinay Sajip
Change by Vinay Sajip : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-10-08 Thread Irit Katriel
Irit Katriel added the comment: This can be closed now - we all agree there is nothing left to do. -- ___ Python tracker ___ ___

[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-10-04 Thread Irit Katriel
Irit Katriel added the comment: The missing target error was fixed under issue41503 -- ___ Python tracker ___ ___ Python-bugs-list

[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-10-04 Thread Kostis Anagnostopoulos
Kostis Anagnostopoulos added the comment: Have nothing else to say on top of what iritkatriel discovered, a double-check would be needed, but may be a pointless speed up, if MemoryHandler is impossible to work without a `target`. Fixing the no-target error is more important. Actually

[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-10-04 Thread Vinay Sajip
Vinay Sajip added the comment: OK, I'll mark as pending and close in a few days if nothing more is heard from Kostis. -- status: open -> pending ___ Python tracker ___

[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-10-04 Thread Irit Katriel
Irit Katriel added the comment: I think this issue should be closed - Kostis doesn't seem keen to discuss the merits of this change, and as I've said I don't think it's worth pursuing. -- ___ Python tracker

[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-08-18 Thread Irit Katriel
Irit Katriel added the comment: I think it is unlikely that this change would make a measurable speedup (benchmarks would be needed to prove that it does). And even if it does, it's for the case where no target has been set, in which case the logger isn't doing anything anyway. Why is this

[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-08-07 Thread Irit Katriel
Irit Katriel added the comment: Regarding the change you suggest here - I think you need add another check that target is not None after you've acquired the lock to make it safe. -- ___ Python tracker

[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-08-07 Thread Irit Katriel
Irit Katriel added the comment: I guess the missing lock in setTarget is a different issue than the one you raise here and should be a separate ticket - I will create one. -- ___ Python tracker

[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-08-07 Thread Irit Katriel
Irit Katriel added the comment: Actually the lock is needed and it is currently missing from setTarget. The script below causes handle to be called on None, causing: File "C:\Users\User\src\cpython\lib\logging\handlers.py", line 1265, in emit self.flush() File

[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-08-05 Thread Kostis Anagnostopoulos
New submission from Kostis Anagnostopoulos : The `logging.handlers.MemoryHandler.flush()` method acquire the lock even if target has not been set, and the method is a noop: ``` def flush(self): # (Docstring skipped) self.acquire() try: if self.target: for