Use threading.RLock() locks for global values in chatcommunicate.py #7033
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In CI testing, we've been getting a notable number of errors in
test/test_chatcommunicate.py
and some other affected tests. These have indicated real thread safety issues in chatcommunicate.py (and some in the tests themselves). This PR is intended to resolve those issues.In order to resolve the thread safety issues in chatcommunicate.py and resolve some issues in CI testing this PR:
threading.RLock()
locks for each of the global values in chatcommunicate.py, or groups of values which are used in similar areas, within chatcommunicate.py.test_validate_yaml()
to perform some additional tests and display the results for all users, rather than failing after a single problem user and reporting only that one, when there might be additional issues.These changes should largely resolve the failing tests noted in issue #6955. It's possible that there are remaining issues which are not addressed here, but this should be the bulk of the failing tests I've seen reported.
Testing of the changes in this PR was done in the Makyen Test 02 chat room around here for about 4 hours of running a test SD instance doing normal scanning and some chat commands. The latter two commits were not included in that testing, but those commits affect only CI testing.