Projects are not built in the correct build agent when the project is already in the build queue and then triggered to be built again

Details

Description

For example, you have two build agents configured (BA1 and BA2) and you also have two schedules configured (WINDOWS_DEV_BUILD and NIGHTLY_BUILD). Now, let's say your WINDOWS_DEV_BUILD runs at 6pm, 8pm and 10pm, while your NIGHLTY_BUILD runs at 11pm. You have a set of projects which have two build definitions, BDEF1 which is attached to the WINDOWS_DEV_BUILD schedule and targeted to build at build agent BA1, and BDEF2 which is set to "always build" and is attached to the NIGHTLY_BUILD schedule and targeted to build at build agent BA2.

At 10pm, the WINDOWS_DEV_BUILD schedule fires and queues the attached projects in BA1. Let's say the build is slow and by 11pm, some of the projects haven't finished building and were still queued. When the NIGHTLY_BUILD schedule fires, the same set of projects are added to the build queue. If you look at the Queues page, you will see that they are also queued in build agent BA1 whereas they should have been queued in build agent BA2 (where they were targeted to build).