STINNER Victor <vstin...@python.org> added the comment:

There is a race condition. The main thread closes a file descriptor which is 
part of the asyncore loop "map", a thread polls on the asyncore "map" file 
descriptors.

-- Main thread --

Close a socket:

  File "/usr/home/vstinner/python/master/Lib/test/test_logging.py", line 1072, 
in test_basic                                                                   
    server.stop()                                                              
  File "/usr/home/vstinner/python/master/Lib/test/test_logging.py", line 870, 
in stop                                                                         
 
    self.close()                                                               

-- TestSMTPServer thread --

Wait in asyncore.loop():
                      
Exception in thread Thread-1 (serve_forever):                                   
                                                                               
Traceback (most recent call last):                                             
  File "/usr/home/vstinner/python/master/Lib/threading.py", line 990, in 
_bootstrap_inner                                                                
      
    self.run()                                                                 
  File "/usr/home/vstinner/python/master/Lib/threading.py", line 928, in run    
                                                                               
    self._target(*self._args, **self._kwargs)                                  
  File "/usr/home/vstinner/python/master/Lib/test/test_logging.py", line 863, 
in serve_forever                                                                
 
    asyncore.loop(poll_interval, map=self._map)                                
  File "/usr/home/vstinner/python/master/Lib/asyncore.py", line 211, in loop    
                                                                               
    poll_fun(timeout, map)                                                     
  File "/usr/home/vstinner/python/master/Lib/asyncore.py", line 145, in poll    
                                                                               
    r, w, e = select.select(r, w, e, timeout)                                  
OSError: [Errno 9] Bad file descriptor

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43842>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to