This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Connor.Wolf
Recipients Connor.Wolf, Giovanni.Bajo, bobbyi, dan.oreilly, emptysquare, forest_atq, gregory.p.smith, ionelmc, jcea, lesha, neologix, nirai, nirs, pitrou, sbt, sdaoden, tshepang, vinay.sajip, vstinner
Date 2016-07-09.04:44:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> Python 3.5.1+ (default, Mar 30 2016, 22:46:26)

Whatever the stock 3.5 on ubuntu 16.04 x64 is.

I've actually been running into a whole horde of really bizarre issues related to what I /think/ is locking in stdout. 

Basically, I have a context where I have thousands and thousands of (relatively short lived) `multiprocessing.Process()` processes, and over time they all get wedged (basically, I have ~4-32 processes alive at any time, but they all get recycled every few minutes).

After doing some horrible ( hackery in the logging module, I'm not seeing processes get wedged there, but I do still encounter issues with what I can only assume is a lock in the print statement. I'm hooking into a wedged process using [pystuck](

durr@rwpscrape:/media/Storage/Scripts/ReadableWebProxy⟫ pystuck --port 6675
Welcome to the pystuck interactive shell.
Use the 'modules' dictionary to access remote modules (like 'os', or '__main__')
Use the `%show threads` magic to display all thread stack traces.

In [1]: show threads
<_MainThread(MainThread, started 140574012434176)>
  File "", line 74, in <module>
  File "", line 57, in go
  File "/media/Storage/Scripts/ReadableWebProxy/WebMirror/", line 453, in run
    living = sum([manager.check_run_jobs() for manager in managers])
  File "/media/Storage/Scripts/ReadableWebProxy/WebMirror/", line 453, in <listcomp>
    living = sum([manager.check_run_jobs() for manager in managers])
  File "/media/Storage/Scripts/ReadableWebProxy/WebMirror/", line 364, in check_run_jobs
  File "/usr/lib/python3.5/multiprocessing/", line 105, in start
    self._popen = self._Popen(self)
  File "/usr/lib/python3.5/multiprocessing/", line 212, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/usr/lib/python3.5/multiprocessing/", line 267, in _Popen
    return Popen(process_obj)
  File "/usr/lib/python3.5/multiprocessing/", line 20, in __init__
  File "/usr/lib/python3.5/multiprocessing/", line 74, in _launch
    code = process_obj._bootstrap()
  File "/usr/lib/python3.5/multiprocessing/", line 249, in _bootstrap
  File "/usr/lib/python3.5/multiprocessing/", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/media/Storage/Scripts/ReadableWebProxy/WebMirror/", line 145, in run
  File "/media/Storage/Scripts/ReadableWebProxy/WebMirror/", line 101, in go"RunInstance starting!")
  File "/usr/lib/python3.5/logging/", line 1279, in info
    self._log(INFO, msg, args, **kwargs)
  File "/usr/lib/python3.5/logging/", line 1415, in _log
  File "/usr/lib/python3.5/logging/", line 1425, in handle
  File "/usr/lib/python3.5/logging/", line 1487, in callHandlers
  File "/usr/lib/python3.5/logging/", line 855, in handle
  File "/media/Storage/Scripts/ReadableWebProxy/", line 134, in emit

<Thread(Thread-4, started daemon 140573656733440)>
  File "/usr/lib/python3.5/", line 882, in _bootstrap
  File "/usr/lib/python3.5/", line 914, in _bootstrap_inner
  File "/usr/lib/python3.5/", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.5/dist-packages/rpyc/utils/", line 241, in start
  File "/usr/local/lib/python3.5/dist-packages/rpyc/utils/", line 128, in accept
    sock, addrinfo = self.listener.accept()
  File "/usr/lib/python3.5/", line 195, in accept
    fd, addr = self._accept()

<Thread(Thread-5, started daemon 140573665126144)>
  File "/usr/local/lib/python3.5/dist-packages/pystuck/", line 15, in thread_frame_generator
    yield (thread_, frame)

So, somehow the print() statement is blocking, which I have /no/ idea how to go about debugging. I assume there's a lock /in/ the print statement function call, and I'm probably going to look into wrapping both the print() call and the multiprocessing.Process() call  execution in a single, shared multiprocessing lock, but that
seems like a very patchwork solution to something that should just work.
Date User Action Args
2016-07-09 04:44:45Connor.Wolfsetrecipients: + Connor.Wolf, gregory.p.smith, vinay.sajip, jcea, nirs, pitrou, vstinner, nirai, forest_atq, ionelmc, bobbyi, neologix, Giovanni.Bajo, sdaoden, tshepang, sbt, lesha, emptysquare, dan.oreilly
2016-07-09 04:44:44Connor.Wolfsetmessageid: <>
2016-07-09 04:44:44Connor.Wolflinkissue6721 messages
2016-07-09 04:44:43Connor.Wolfcreate