alpha-unito / streamflow

StreamFlow Workflow Manager
https://streamflow.di.unito.it
GNU Lesser General Public License v3.0
52 stars 13 forks source link

Fix concurrency in `DefaultScheduler` #584

Closed GlassOfWhiskey closed 1 week ago

GlassOfWhiskey commented 1 week ago

Now that hardware resources are checked for thw whole stack of Connector objects, just locking on a single Condition related to the outermost Connector is not enough to prevent race conditions. This commit ensures that a Lock object for each Connector in the stack is acquired prior to reserve or release resources during scheduling. Locks are always acquired and released in order, preventing deadlocks.

In addition, this commit makes the ConnectorWrapper compatible with the FutureConnector feature by extending the FutureAware class.

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 94.11765% with 2 lines in your changes missing coverage. Please review.

Project coverage is 70.42%. Comparing base (a15474b) to head (e26e49b). Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
streamflow/scheduling/scheduler.py 93.75% 0 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #584 +/- ## ========================================== + Coverage 70.38% 70.42% +0.04% ========================================== Files 87 87 Lines 11010 11027 +17 Branches 2288 2292 +4 ========================================== + Hits 7749 7766 +17 - Misses 2800 2814 +14 + Partials 461 447 -14 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.