🐛 swu: protect against potential deadlock
If for some reason an exception gets thrown inside get_current_versions that doesn't get caught therein, `_get_versions_data_ready` will never be set and thus any calls waiting for it will block forever. This patch fixes that by always setting the event in the `finally` block.
This commit is contained in:
1 parent
13365e1f81
commit
cc0f1e29f7
1 file changed
+1
-1
@@ -1766,9 +1766,9 @@ class SoftwareUpdatePlugin(
|
||||
self._save_version_cache()
|
||||
|
||||
self._get_versions_data = information, update_available, update_possible
|
||||
self._get_versions_data_ready.set()
|
||||
finally:
|
||||
self._get_versions_mutex.release()
|
||||
self._get_versions_data_ready.set()
|
||||
|
||||
else: # something's already in progress, let's wait for it to complete and use its result
|
||||
self._get_versions_data_ready.wait()
|
||||
|
||||
Reference in new issue
Block a user