Title: Inefficiency with SocketHandler - may send log record message string twice in pickled data structure
Type: resource usage Stage: resolved
Components: Library (Lib) Versions: Python 3.6, Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Marvin Greenberg, python-dev, vinay.sajip
Priority: normal Keywords: patch

Created on 2015-11-20 19:06 by Marvin Greenberg, last changed 2015-12-26 12:52 by python-dev. This issue is now closed.

File name Uploaded Description Edit Marvin Greenberg, 2015-11-20 19:06 Patch to remove redundant data sent
Messages (2)
msg255011 - (view) Author: Marvin Greenberg (Marvin Greenberg) * Date: 2015-11-20 19:06
In logging.handlers.SocketHandler.makePickle code was added for issue 14436 that replaces the 'msg' in the log record dict with the formatted message.  But if an earlier handler already formatted the message, it will have been added to the log record with key 'message'.  In this case the identical message will be sent across the wire twice in the pickled data.

The patch simply deletes the 'message' entry from the dict.  More involved changes (like reusing record.message instead of calling getMessage) probably not useful.
msg257030 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-12-26 12:52
New changeset 6210b41a2394 by Vinay Sajip in branch '3.5':
Closes #25685: Made SocketHandler emission more efficient.

New changeset 6a6a68a3d323 by Vinay Sajip in branch 'default':
Closes #25685: Merged fix from 3.5.
Date User Action Args
2015-12-26 12:52:00python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg257030

resolution: fixed
stage: patch review -> resolved
2015-11-20 19:38:36SilentGhostsetnosy: + vinay.sajip
stage: patch review

versions: + Python 3.6
2015-11-20 19:06:50Marvin Greenbergcreate