~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/server.py

  • Committer: John Arbash Meinel
  • Date: 2011-09-26 10:44:47 UTC
  • mto: This revision was merged to the branch mainline in revision 6170.
  • Revision ID: john@arbash-meinel.com-20110926104447-1wo6rhxpqei3xz7z
Some cleanups

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
            hook(backing_urls, self.get_url())
165
165
 
166
166
    def _stop_gracefully(self):
167
 
        # XXX: ATM, once we see the self._should_terminate we immediately exit
168
 
        #      without waiting for client threads to shut down. (I don't know
169
 
        #      if we *can* because they are marked as Daemon.)
170
 
        #      Which means that while in-theory this is a graceful shutdown,
171
 
        #      because we don't actively close the connections, etc, we don't
172
 
        #      have a good way (yet) to poll the spawned clients and
173
167
        trace.note(gettext('Requested to stop gracefully'))
174
168
        self._should_terminate = True
175
169
        self._gracefully_stopping = True
216
210
                        pass
217
211
                    except self._socket_error, e:
218
212
                        # if the socket is closed by stop_background_thread
219
 
                        # we might get a EBADF here, any other socket errors
220
 
                        # should get logged.
 
213
                        # we might get a EBADF here, or if we get a signal we
 
214
                        # can get EINTR, any other socket errors should get
 
215
                        # logged.
221
216
                        if e.args[0] not in (errno.EBADF, errno.EINTR):
222
217
                            trace.warning(gettext("listening socket error: %s")
223
218
                                          % (e,))