Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Fix deadlock scenario in AsyncOperationProcessor and re-enable WorldStateDownloaderTest #1126

Merged
merged 7 commits into from
Mar 19, 2019

Conversation

ajsutton
Copy link
Contributor

PR description

AsyncOperationProcessor could wind up deadlocked if it is processing the last requests in a download which complete while its output pipe is full. Instead of blocking waiting to be able to output the completed results, it loops back round to see if it can start more tasks but winds up blocked on the pipe.get() call. That call will never return because the pipeline is just waiting for the final requests to complete and will then close but we're now stuck.

Since the aim of each pipeline stage is to keep its output buffer full, we now block until the outputs can be added, avoiding the deadlock. This potentially means some requests which could have been started are delayed but if the downstream stages are the bottleneck that won't matter anyway.

@ajsutton ajsutton marked this pull request as ready for review March 18, 2019 23:47
@ajsutton ajsutton merged commit e6c85bd into PegaSysEng:master Mar 19, 2019
@ajsutton ajsutton deleted the restore-worldstatedownloadertest branch March 19, 2019 19:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants