[issue30830] test_logging leaks dangling threads on FreeBSD

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:

Ok, the main bugs have been fixed by the following socketserver fix.

commit b8f4163da30e16c7cd58fe04f4b17e38d53cd57e
Author: Victor Stinner 
Date:   Wed Sep 13 01:47:22 2017 -0700

bpo-31233: socketserver.ThreadingMixIn.server_close() (#3523)

socketserver.ThreadingMixIn now keeps a list of non-daemonic threads
to wait until all these threads complete in server_close().

Reenable test_logging skipped tests.

Fix SocketHandlerTest.tearDown(): close the socket handler before
stopping the server, so the server can join threads.

I'm not sure that it's possible to fix the bug in Python 3.6 without breaking 
the backward compatibility.

test_logging shouldn't fail with the threading_cleanup() warning anymore.

--
dependencies:  -socketserver.ThreadingMixIn leaks running threads after 
server_close()
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 97d7e65dfed1d42d40d9bc2f630af56240555f02 by Victor Stinner in 
branch 'master':
bpo-30830: logging.config.listen() calls server_close() (#3524)
https://github.com/python/cpython/commit/97d7e65dfed1d42d40d9bc2f630af56240555f02


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-09-12 Thread STINNER Victor

STINNER Victor added the comment:

While testing PR 3138 (stricter threading_cleanup) with PR 3523 (socketserver 
joins threads), I got the following warning:

test_listen_config_1_ok (test.test_logging.ConfigDictTest) ... Warning -- 
threading_cleanup() detected 1 leaked threads (count: 1, dangling: 2)
ok

Attached PR 3524 should fix this warning, once combined with PR 3523.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-09-12 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3523

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-09-12 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +patch
pull_requests: +3522
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

> New changeset 6966960468327c958b03391f71f24986bd697307 by Victor Stinner in 
> branch 'master':
> bpo-30830: test_logging uses threading_setup/cleanup (#3137)

With this commit, test_logging should detect better bugs in the code.

The commit also skips all tests using socketserver, until bpo-31233 is fixed, 
just to reduce the failure rate on the FreeBSD buildbots.

This issue (bpo-30830) made FreeBSD 10 buildbot very unstable.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 6966960468327c958b03391f71f24986bd697307 by Victor Stinner in 
branch 'master':
bpo-30830: test_logging uses threading_setup/cleanup (#3137)
https://github.com/python/cpython/commit/6966960468327c958b03391f71f24986bd697307


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

I opened bpo-31233: socketserver.ThreadingMixIn leaks running threads after 
server_close().

--
dependencies: +socketserver.ThreadingMixIn leaks running threads after 
server_close()

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3171

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

> Example:
>
> 10-STABLE-amd64% ./python -m test -v test_logging --fail-env-changed -F -m 
> test.test_logging.DatagramHandlerTest.test_output -m 
> test.test_logging.ConfigDictTest.test_listen_config_10_ok  
> --match=test.test_logging.SocketHandlerTest.test_output

Oh, I forgot to mention that I also run "./python -m test -j4" in a different 
terminal in parallel to make the bug more likely.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

The problem is that socketserver.ThreadingMixIn spawns threads without waiting 
for their completion in server_close(). For example, the following two tests 
use socketserver.ThreadingMixIn and so can leak a running thread:

* test.test_logging.SocketHandlerTest.test_output()
* test.test_logging.DatagramHandlerTest.test_output()

Example:

10-STABLE-amd64% ./python -m test -v test_logging --fail-env-changed -F -m 
test.test_logging.DatagramHandlerTest.test_output -m 
test.test_logging.ConfigDictTest.test_listen_config_10_ok  
--match=test.test_logging.SocketHandlerTest.test_output

(...)

0:00:09 load avg: 2.54 [  7] test_logging
test_output (test.test_logging.SocketHandlerTest) ... ok
test_output (test.test_logging.DatagramHandlerTest) ... ok
test_listen_config_10_ok (test.test_logging.ConfigDictTest) ... threading_setup 
(1, <_weakrefset.WeakSet object at 0x806243398>)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3170

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-16 Thread STINNER Victor

STINNER Victor added the comment:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.x%20Shared%203.x/builds/698/steps/test/logs/stdio

test_output (test.test_logging.UnixDatagramHandlerTest) ... ok
test_output (test.test_logging.UnixSysLogHandlerTest) ... ok
test__all__ (test.test_logging.MiscTestCase) ... ok
test_handle_called_with_mp_queue (test.test_logging.QueueListenerTest) ... 
Warning -- threading_cleanup() failed to cleanup -1 threads after 3 sec (count: 
0, dangling: 1)
ok
test_handle_called_with_queue_queue (test.test_logging.QueueListenerTest) ... ok
test_no_messages_in_queue_after_stop (test.test_logging.QueueListenerTest) ... 
ok

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-10 Thread STINNER Victor

Changes by STINNER Victor :


--
title: test_logging leaks a "dangling" threads on FreeBSD -> test_logging leaks 
dangling threads on FreeBSD

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com