File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -162,14 +162,17 @@ def flush(self) -> None:
162162 # Ensures that, upon return from this call, all updates available before this call have
163163 # been processed. To do so, we send a UDP packet to the socket to wake it up and wait until
164164 # it is received. This does not guarantee that file-based updates are necessarily
165- # processes, since that depends on many factors.
165+ # processed, since that depends on many factors.
166+ # On the minus side, this method, as implemented, can cause deadlocks if the socket
167+ # reads fail for unexpected reasons. This should probably be accounted for.
166168 token = '_SYNC ' + str (random .getrandbits (128 ))
167169 sock = socket .socket (socket .AF_INET , socket .SOCK_DGRAM )
168170 sock .sendto (bytes (token , 'utf-8' ), ('127.0.0.1' , self .update_port ))
169171 delay = 0.0001
170172 while token not in self ._sync_ids :
171173 time .sleep (delay )
172174 delay *= 2
175+ self ._sync_ids .remove (token )
173176
174177 def _process_update_data (self , data : bytes ) -> None :
175178 sdata = data .decode ('utf-8' )
You can’t perform that action at this time.
0 commit comments