[issue13140] ThreadingMixIn.daemon_threads is not honored when parent is daemon
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset f09e3b1603ee by Florent Xicluna in branch '2.7': Issue #13140: Fix the daemon_threads attribute of ThreadingMixIn. http://hg.python.org/cpython/rev/f09e3b1603ee New changeset 94017ce9304d by Florent Xicluna in branch '3.2': Closes #13140: Fix the daemon_threads attribute of ThreadingMixIn. http://hg.python.org/cpython/rev/94017ce9304d New changeset 6fe6769e54a5 by Florent Xicluna in branch 'default': Merge 3.2: issue #13140 http://hg.python.org/cpython/rev/6fe6769e54a5 -- nosy: +python-dev resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13140 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13140] ThreadingMixIn.daemon_threads is not honored when parent is daemon
Florent Xicluna florent.xicl...@gmail.com added the comment: I agree it is a bug. It does not make sense to preserve this behaviour. I plan to apply the initial patch by Charles-François to 2.7 and 3.x. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13140 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13140] ThreadingMixIn.daemon_threads is not honored when parent is daemon
Changes by Florent Xicluna florent.xicl...@gmail.com: -- assignee: - flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13140 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13140] ThreadingMixIn.daemon_threads is not honored when parent is daemon
Charles-François Natali neolo...@free.fr added the comment: I would prefer to preserve the inheritance by default, and to change the daemonic attribute only if it is explicitly set to True or False. This way it will be backward compatible. It may be backward compatible, but IMHO, the current behavior is broken: while it can certainly make sense to set the server thread daemonic, you most certainly don't want to have client threads daemonic implicitely (since you usually don't want to terminate the client's connections abruptly when the main thread exits). But I must admit I don't have a strong opinion, so both solutions are OK to me. The only thing that bothers me is this: +.. versionchanged:: 3.3 + previously, the *daemon_threads = False* flag was ignored. You usually document new features or behavior changes: this really looks like a bug fix (and is one actually). Something like the semantics of *daemon_threads* changed slighty might be better (but I'm no native speaker). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13140 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13140] ThreadingMixIn.daemon_threads is not honored when parent is daemon
Florent Xicluna florent.xicl...@gmail.com added the comment: I would prefer to preserve the inheritance by default, and to change the daemonic attribute only if it is explicitly set to True or False. This way it will be backward compatible. Patch attached. -- versions: -Python 2.6 Added file: http://bugs.python.org/file23499/issue13140.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13140 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13140] ThreadingMixIn.daemon_threads is not honored when parent is daemon
Charles-François Natali neolo...@free.fr added the comment: Start a new thread to process the request. t = threading.Thread(target = self.process_request_thread, args = (request, client_address)) if self.daemon_threads: t.daemon = True If daemon_threads is false, t.daemon is not set, and the daemonic property is inherited from the creating thread, i.e. the server thread. Patch attached (I don't think a test is necessary for such a trivial change). -- keywords: +needs review, patch nosy: +haypo, neologix stage: needs patch - patch review Added file: http://bugs.python.org/file23491/socketserver_daemon.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13140 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13140] ThreadingMixIn.daemon_threads is not honored when parent is daemon
New submission from Florent Xicluna florent.xicl...@gmail.com: I use the socketserver.ThreadingMixIn to create a TCPServer. I set the server thread as daemon (t.daemon=True). But I want the client threads to run as non-daemon. According to the documentation, the daemon_threads class attribute should do the trick. But it fails: if server is daemon, the clients are daemon too, even if daemon_threads=False. Demo attached. -- components: Library (Lib) files: test_socketserver.py messages: 145273 nosy: flox priority: normal severity: normal stage: needs patch status: open title: ThreadingMixIn.daemon_threads is not honored when parent is daemon type: behavior versions: Python 2.6, Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file23361/test_socketserver.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13140 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com