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.
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.