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.
Description
Right now the RWLock based on https://gist.github.com/CMCDragonkai/4de5c1526fc58dac259e321db8cf5331 is read-preferring.
This means on blocking methods, such as the
compose
method in the networking domain, concurrent pressure can starve the stop operation.Changing to write-preferring RWLock allows us to ensure that we can call
stop
and interrupt any of the blocking decorated methods. This is more robust for denial of service and preventing long-shutdowns.Any other concurrent calls should then throw an exception once stop has interrupted them.
Note that this is not the same as the abort signal. Calling stop cannot abort asynchronous operations atm. Any locked async operation is still waited to be completed.
Aborting would require more study and research in MatrixAI/Polykey#297
Issues Fixed
Tasks
Final checklist