We had a race here where the non-blocking pending execution would be starved of executing threads.
This happened when all the current holders of permits from the semaphore would release their permit after a producer thread failed to acquire a permit and then enqueued its task.
=> need to peek the queue again after releasing the permit and try to acquire a new permit if there's work left to be done to avoid this scenario.
We had a race here where the non-blocking pending execution would be starved of executing threads. This happened when all the current holders of permits from the semaphore would release their permit after a producer thread failed to acquire a permit and then enqueued its task. => need to peek the queue again after releasing the permit and try to acquire a new permit if there's work left to be done to avoid this scenario.
back port of #116264
fixes #117811