Show More
@@ -342,7 +342,7 b' class pipeservice(object):' | |||
|
342 | 342 | sv.cleanup() |
|
343 | 343 | _restoreio(ui, fin, fout) |
|
344 | 344 | |
|
345 | def _serverequest(ui, repo, conn, createcmdserver): | |
|
345 | def _initworkerprocess(): | |
|
346 | 346 | # use a different process group from the master process, making this |
|
347 | 347 | # process pass kernel "is_current_pgrp_orphaned" check so signals like |
|
348 | 348 | # SIGTSTP, SIGTTIN, SIGTTOU are not ignored. |
@@ -351,6 +351,7 b' def _serverequest(ui, repo, conn, create' | |||
|
351 | 351 | # same state inherited from parent. |
|
352 | 352 | random.seed() |
|
353 | 353 | |
|
354 | def _serverequest(ui, repo, conn, createcmdserver): | |
|
354 | 355 | fin = conn.makefile('rb') |
|
355 | 356 | fout = conn.makefile('wb') |
|
356 | 357 | sv = None |
@@ -385,8 +386,6 b' def _serverequest(ui, repo, conn, create' | |||
|
385 | 386 | except IOError as inst: |
|
386 | 387 | if inst.errno != errno.EPIPE: |
|
387 | 388 | raise |
|
388 | # trigger __del__ since ForkingMixIn uses os._exit | |
|
389 | gc.collect() | |
|
390 | 389 | |
|
391 | 390 | class unixservicehandler(object): |
|
392 | 391 | """Set of pluggable operations for unix-mode services |
@@ -517,8 +516,12 b' class unixforkingservice(object):' | |||
|
517 | 516 | |
|
518 | 517 | def _serveworker(self, conn): |
|
519 | 518 | signal.signal(signal.SIGCHLD, self._oldsigchldhandler) |
|
519 | _initworkerprocess() | |
|
520 | 520 | h = self._servicehandler |
|
521 | _serverequest(self.ui, self.repo, conn, h.createcmdserver) | |
|
521 | try: | |
|
522 | _serverequest(self.ui, self.repo, conn, h.createcmdserver) | |
|
523 | finally: | |
|
524 | gc.collect() # trigger __del__ since worker process uses os._exit | |
|
522 | 525 | |
|
523 | 526 | _servicemap = { |
|
524 | 527 | 'pipe': pipeservice, |
General Comments 0
You need to be logged in to leave comments.
Login now