ash-project / reactor

Reactor is a dynamic, concurrent, dependency resolving saga orchestrator.
https://ash-hq.org/
MIT License
44 stars 6 forks source link

fix: don't deadlock when lots of async reactors are sharing a concurrency pool. #36

Closed jimsynz closed 1 year ago

zachdaniel commented 1 year ago

Some notes from a discussion:

state.current_tasks needs to not be used anywhere to limit, we should instead atomically "claim X or fewer available concurrency limit" and then start those tasks. And state.current_tasks is just for us to track what is currently running, not playing a part in the concurrency limit calculation.