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 @@ -27,8 +27,16 @@ def is_owner(self):
2727
2828 def force_cleanup (self ):
2929 assert not self .is_owner
30- if PLATFORM != "win" and os .path .exists (self ._address ):
31- os .unlink (self ._address )
30+ if PLATFORM != "win" :
31+ try :
32+ os .unlink (self ._address )
33+ except FileNotFoundError :
34+ # possible race condition: a ConnectionResetError might be caused
35+ # by the previous instance dying just as this instance tries to
36+ # connect to it. In that case self._address would have existed
37+ # at the creation of controller but now no longer exists.
38+ # We ignore the error
39+ pass
3240 return True
3341 return False
3442
Original file line number Diff line number Diff line change @@ -158,6 +158,7 @@ def main():
158158 # Assume the previous instance died, leaving
159159 # a stray socket, try cleaning it...
160160 if not controller .force_cleanup ():
161+ log .error ('force cleaning failed' )
161162 raise
162163 # ...and restart.
163164 code = - 1
You can’t perform that action at this time.
0 commit comments