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 Arkady M
Recipients Arkady M
Date 2020-06-04.03:06:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1591239973.04.0.347860195364.issue40860@roundup.psfhosted.org>
In-reply-to
Content
I am running an HTTP server (socketserver.ThreadingMixIn, http.server.HTTPServer) in a Docker container (FROM ubuntu:19.10)

Occasionally I get an exception:

Exception happened during processing of request from ('172.17.0.1', 35756)
Traceback (most recent call last):
  File "/usr/lib/python3.7/socketserver.py", line 650, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "service.py", line 221, in __init__
    super(UrlExtractorServer, self).__init__(*args, **kwargs)
  File "/usr/lib/python3.7/socketserver.py", line 720, in __init__
    self.handle()
  File "/usr/lib/python3.7/http/server.py", line 426, in handle
    self.handle_one_request()
  File "/usr/lib/python3.7/http/server.py", line 414, in handle_one_request
    method()
  File "service.py", line 488, in do_POST
    self._post_extract(url)
  File "service.py", line 459, in _post_extract
    extracted_links, err_msg = self._extract_links(transaction_id, attachment_id, zip_password, data)
  File "service.py", line 403, in _extract_links
    error, results = call_timeout(process_deadline, extractor.extract_links_binary_multiprocess, args=data)
  File "service.py", line 175, in call_timeout
    manager = multiprocessing.Manager()
  File "/usr/lib/python3.7/multiprocessing/context.py", line 56, in Manager
    m.start()
  File "/usr/lib/python3.7/multiprocessing/managers.py", line 563, in start
    self._process.start()
  File "/usr/lib/python3.7/multiprocessing/process.py", line 111, in start
    _cleanup()
  File "/usr/lib/python3.7/multiprocessing/process.py", line 56, in _cleanup
    if p._popen.poll() is not None:
AttributeError: 'NoneType' object has no attribute 'poll'


I am in the process of preparingof of a reasonably simple piece of code demonstrating the problem.

Meanwhile the following can be important. In the code below I ma getting the elapse < timeout (20 times from 70K). In all case psutil.Process() returned psutil.NoSuchProcess

    time_start = time.time()
    job = multiprocessing.Process(target=func, args=(args, results), kwargs=kwargs)
    job.start()
    job.join(timeout)
    elapsed = time.time()-time_start
    if job.is_alive():
        try:
            process = psutil.Process(job.pid)
            process_error = f"pid {job.pid} status {process.status} {process}"
        except Exception as e:
            process_error = f"psutil.Process() failed {e}"
        if elapsed < timeout:
            print("elapsed < timeout")
History
Date User Action Args
2020-06-04 03:06:13Arkady Msetrecipients: + Arkady M
2020-06-04 03:06:13Arkady Msetmessageid: <1591239973.04.0.347860195364.issue40860@roundup.psfhosted.org>
2020-06-04 03:06:13Arkady Mlinkissue40860 messages
2020-06-04 03:06:12Arkady Mcreate