Skip to content

Add feature flag to disable spawn token queue

Sami Hiltunen requested to merge smh-remove-spawn-token into master

Gitaly has a spawn token queue that is used to limit the number of concurrent processes being spawned. This was needed back in the day as Go had acquired a lock on forking. High number of concurrent forking operations would lead to goroutines piling up on the lock. As a mutex locking operation can't be cancelled by context, this could lead to a pile up of goroutines. The spawn token queue on the other hand respected context cancelation so it was used to limit the number of processes waiting on the fork lock.

Go 1.21 removed the fork lock so we can now concurrently spawn multiple processes. We can thus remove the spawn token mechanism, and this commit does so behind a feature flag.

Closes #5901 (closed)

Merge request reports

Loading