Reviewed:  https://review.openstack.org/276842
Committed: 
https://git.openstack.org/cgit/openstack/neutron/commit/?id=1cafff087194711399ad2a85a9f394f7204d7bdd
Submitter: Jenkins
Branch:    master

commit 1cafff087194711399ad2a85a9f394f7204d7bdd
Author: dukhlov <dukh...@mirantis.com>
Date:   Fri Feb 5 19:25:42 2016 +0200

    Remove threading before process forking
    
    Forking a process when multiple threads are running is an unsafe
    operation and could cause a lot of problems because only current
    thread will continue working in child thread. Any locked by other
    thread resource will remain locked forever.
    
    We faced with this problem during oslo.messaging development and
    added workaround to hide this problem:
    https://review.openstack.org/#/c/274255/
    
    I tried to fix this problem in oslo.service:
    https://review.openstack.org/#/c/270832/
    
    but oslo folks said that this fix is ugly and it is wrong way to add
    workarounds to common libraries because projects use them incorrectly.
    I think that is fair.
    
    So this patch fixes incorrect usage of oslo libraries. In this patch
    I extended functionality of NeutronWorker and add there
    `worker_process_count` parameter which determines how many processes
    should be spawned for this worker. If `worker_process_count` = 0 - don't
    create process and spawn thread in scope of current process for worker
    
    Then I moved all background tasks to workers and return them by
    `get_workers` method. start_plugin_workers collects plugin's workers
    using `get_workers` method and starts in ProcessLauncher first workers
    with `worker_process_count` > 0 and only after this starts threaded
    workers by simple Launcher
    
    Closes-bug: #1569404
    
    Change-Id: I0544f1d47ae53d572adda872847a56fa0b202d2e


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1569404

Title:
  Remove threading before process forking

Status in neutron:
  Fix Released

Bug description:
   Forking processes when a few threads are already running is
  potentially unsafe operation and could cause a lot of problems because
  only current thread will continue working in child thread. Any locked
  by other thread resource will remain locked forever.

  We faced with this problem during oslo.messaging development and added
  workaround to hide this problem:
  https://review.openstack.org/#/c/274255/ I tried to fix this problem
  in oslo.service: https://review.openstack.org/#/c/270832/ but oslo
  folks said that this fix is ugly and it is wrong way to add
  workarounds to common libraries because projects use them incorrectly.
  I think that is fare.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1569404/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to