classification
Title: Logging libraries BufferingHandler flushed twice at shutdown
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: adamist521, vinay.sajip
Priority: normal Keywords:

Created on 2020-07-29 05:57 by adamist521, last changed 2020-07-29 06:07 by adamist521.

Messages (2)
msg374559 - (view) Author: Tatsunosuke Shimada (adamist521) Date: 2020-07-29 05:57
BufferingHandler

I expected function flush of BufferingHandler called once but it is called twice. 
This is due to that shutdown calls flush before close function which calls flush function inside.
(Faced this issue on my custom implementation of flush function.)

Seems that there is no need of calling flush inside BufferingHandler.

Following is the link to the code of function shutdown and Buffering Handler
https://github.com/python/cpython/blob/0124f2b5e0f88ee7f5d40fca96dbf087cbe4764b/Lib/logging/handlers.py#L1286
https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Lib/logging/__init__.py#L2151

This issue could be also related.
https://bugs.python.org/issue26559
msg374560 - (view) Author: Tatsunosuke Shimada (adamist521) Date: 2020-07-29 06:07
Found related issue.
https://bugs.python.org/issue901330
History
Date User Action Args
2020-07-29 06:07:05adamist521setmessages: + msg374560
2020-07-29 05:57:24adamist521create