components/openstack/swift/patches/rlimit_nproc.patch
branchs11u3-sru
changeset 6035 c9748fcc32de
parent 4072 db0cec748ec0
child 6853 cf1567491b1b
equal deleted inserted replaced
6016:a477397bba8b 6035:c9748fcc32de
     5 
     5 
     6 For the time being, just ignore the use of RLIMIT_NPROC.  This might be
     6 For the time being, just ignore the use of RLIMIT_NPROC.  This might be
     7 appropriate for upstream (but has not been submitted), depending on whether
     7 appropriate for upstream (but has not been submitted), depending on whether
     8 RLIMIT_NPROC is unavailable on any platforms other than Solaris.
     8 RLIMIT_NPROC is unavailable on any platforms other than Solaris.
     9 
     9 
    10 --- swift-2.2.0/swift/common/manager.py
    10 --- swift-2.3.0/swift/common/manager.py.~2~	2016-02-08 01:15:05.393368607 -0800
    11 +++ swift-2.2.0/swift/common/manager.py
    11 +++ swift-2.3.0/swift/common/manager.py	2016-02-08 01:15:05.487373162 -0800
    12 @@ -75,6 +75,8 @@
    12 @@ -76,6 +76,8 @@ def setup_env():
    13      except ValueError:
    13      except ValueError:
    14          print _("WARNING: Unable to modify max process limit.  "
    14          print _("WARNING: Unable to modify max process limit.  "
    15                  "Running as non-root?")
    15                  "Running as non-root?")
    16 +    except AttributeError:
    16 +    except AttributeError:
    17 +        pass
    17 +        pass
    18  
    18  
    19      # Set PYTHON_EGG_CACHE if it isn't already set
    19      # Set PYTHON_EGG_CACHE if it isn't already set
    20      os.environ.setdefault('PYTHON_EGG_CACHE', '/tmp')
    20      os.environ.setdefault('PYTHON_EGG_CACHE', '/tmp')
    21 --- swift-2.2.0/test/unit/common/test_manager.py
    21 --- swift-2.3.0/test/unit/common/test_manager.py.~2~	2016-02-08 01:15:05.394490747 -0800
    22 +++ swift-2.2.0/test/unit/common/test_manager.py
    22 +++ swift-2.3.0/test/unit/common/test_manager.py	2016-02-08 01:20:25.280013617 -0800
    23 @@ -105,9 +105,10 @@
    23 @@ -105,9 +105,10 @@ class TestManagerModule(unittest.TestCas
    24                                            manager.MAX_DESCRIPTORS)),
    24                                            manager.MAX_DESCRIPTORS)),
    25                  (resource.RLIMIT_DATA, (manager.MAX_MEMORY,
    25                  (resource.RLIMIT_DATA, (manager.MAX_MEMORY,
    26                                          manager.MAX_MEMORY)),
    26                                          manager.MAX_MEMORY)),
    27 -                (resource.RLIMIT_NPROC, (manager.MAX_PROCS,
    27 -                (resource.RLIMIT_NPROC, (manager.MAX_PROCS,
    28 -                                         manager.MAX_PROCS)),
    28 -                                         manager.MAX_PROCS)),
    29              ]
    29              ]
    30 +            if getattr(resource, "RLIMIT_NPROC", None):
    30 +            if getattr(resource, "RLIMIT_NPROC", None):
    31 +                expected.append((resource.RLIMIT_NPROC, (manager.MAX_PROCS,
    31 +                expected.append((resource.RLIMIT_NPROC,
    32 +                                         manager.MAX_PROCS)))
    32 +                                 (manager.MAX_PROCS, manager.MAX_PROCS)))
    33              self.assertEquals(manager.resource.called_with_args, expected)
    33              self.assertEquals(manager.resource.called_with_args, expected)
    34              self.assertTrue(
    34              self.assertTrue(
    35                  manager.os.environ['PYTHON_EGG_CACHE'].startswith('/tmp'))
    35                  manager.os.environ['PYTHON_EGG_CACHE'].startswith('/tmp'))