File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,16 @@ def is_owner(self):
2828
2929 def force_cleanup (self ):
3030 assert not self .is_owner
31- if PLATFORM != 'win' and os .path .exists (self ._address ):
32- os .unlink (self ._address )
31+ if PLATFORM != 'win' :
32+ try :
33+ os .unlink (self ._address )
34+ except FileNotFoundError :
35+ # possible race condition: a ConnectionResetError might be caused
36+ # by the previous instance dying just as this instance tries to
37+ # connect to it. In that case self._address would have existed
38+ # at the creation of controller but now no longer exists.
39+ # We ignore the error
40+ pass
3341 return True
3442 return False
3543
Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ def main():
135135 # Assume the previous instance died, leaving
136136 # a stray socket, try cleaning it...
137137 if not controller .force_cleanup ():
138+ log .error ('force cleaning failed' )
138139 raise
139140 # ...and restart.
140141 code = - 1
You can’t perform that action at this time.
0 commit comments