Eventlet seems to be incompatible with multiprocessing/pool.py

Bug #1225275 reported by Joshua Harlow
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Joshua Harlow

Bug Description

The internals of multiprocessing/pool.py seem to use a thread attribute that doesn't exist when eventlet monkey patches the threading module. The error that I am seeing is the following:

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/home/y/lib/python2.6/threading.py", line 532, in __bootstrap_inner
  File "/home/y/lib/python2.6/threading.py", line 484, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/y/lib/python2.6/multiprocessing/pool.py", line 221, in _handle_tasks
    if thread._state:
AttributeError: '_MainThread' object has no attribute '_state'

Likely the eventlet monkey patching does not patch this attribute (is this attribute is a hidden internal of the threading module?). We likely either need to figure out a different pool and use that or pretty clearly document this case and create a threaded impl that will work with eventlet.

Easy way to hit this:

import eventlet

Then try to use the threaded engine.

Joshua Harlow (harlowja)
description: updated
Joshua Harlow (harlowja)
Changed in taskflow:
importance: Undecided → Critical
Revision history for this message
Joshua Harlow (harlowja) wrote :
Joshua Harlow (harlowja)
Changed in taskflow:
assignee: nobody → Joshua Harlow (harlowja)
Changed in taskflow:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to taskflow (master)

Reviewed: https://review.openstack.org/46603
Committed: http://github.com/stackforge/taskflow/commit/86c60dfa60496eaccf16dc50d13ac39f0cae451b
Submitter: Jenkins
Branch: master

commit 86c60dfa60496eaccf16dc50d13ac39f0cae451b
Author: Joshua Harlow <email address hidden>
Date: Fri Sep 13 20:21:03 2013 -0700

    Use executors instead of pools

    A executor is a more generic concept than a pool and
    also seems to work better with eventlet. This is also
    a more supported model of performing concurrent operations
    than using the mostly unknown multiprocessing thread
    pool implementation.

    Fixes: bug 1225275

    Change-Id: I09e9a9000bc88cc57d51342b83b31f97790a62e9

Changed in taskflow:
status: In Progress → Fix Committed
Changed in taskflow:
status: Fix Committed → Fix Released
Paul White (paulw2u)
Changed in ubuntu:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers