~ubuntu-branches/ubuntu/trusty/swift/trusty-updates

« back to all changes in this revision

Viewing changes to swift/common/manager.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2013-01-28 09:40:30 UTC
  • mfrom: (1.2.16)
  • Revision ID: package-import@ubuntu.com-20130128094030-aetz57x2qz9ye2d4
Tags: 1.7.6-0ubuntu1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
# don't use that type-server.conf file and instead use their own.
44
44
STANDALONE_SERVERS = ['object-expirer']
45
45
 
46
 
KILL_WAIT = 15  # seconds to wait for servers to die
 
46
KILL_WAIT = 15  # seconds to wait for servers to die (by default)
47
47
WARNING_WAIT = 3  # seconds to wait after message that may just be a warning
48
48
 
49
49
MAX_DESCRIPTORS = 32768
218
218
                         for p in pids]
219
219
        # keep track of the pids yeiled back as killed for all servers
220
220
        killed_pids = set()
 
221
        kill_wait = kwargs.get('kill_wait', KILL_WAIT)
221
222
        for server, killed_pid in watch_server_pids(server_pids,
222
 
                                                    interval=KILL_WAIT,
 
223
                                                    interval=kill_wait,
223
224
                                                    **kwargs):
224
225
            print _("%s (%s) appears to have stopped") % (server, killed_pid)
225
226
            killed_pids.add(killed_pid)
232
233
            if not killed_pids.issuperset(pids):
233
234
                # some pids of this server were not killed
234
235
                print _('Waited %s seconds for %s to die; giving up') % (
235
 
                    KILL_WAIT, server)
 
236
                    kill_wait, server)
236
237
        return 1
237
238
 
238
239
    @command