In our project we heavily use multiprocess cooking together with iterative cooking (legacyiterative).
After upgrading to UE 5.6 we now noticed following warning messages being printed in our cooker “Package was added to the runtime discovery queue after starting BuildDependencies phase”. They occur when doing an iterative + multiprocess cook right after having done a full cook, so essentially all assets are up-to-date and there is no work to be done by the child cookers. All the packages for which this warning is being printed appear to be from the EInstigator::StartupPackage set.
I found that in CL 38852986 Epic attempted to address this issue by adding a PhaseTransitionFence which ensures that parent cooker waits for child cookers to send any and all their messages before it proceeds to the ECookPhase::BuildDependencies phase. I noticed that this fence wasn’t being waited on properly because the very first fence we send, which is sent using the heartbeat system, has a value of 0 and the FCookWorkerServer::LastReceivedHeartbeatNumber being also initialized to 0 means that we never wait on this very first fence. Initializing the FCookWorkerServer::LastReceivedHeartbeatNumber to -1 addresses this fence issue, and fixes the warning messages.
One side effect of this is that a fully up-to-date cook now has to wait for the child cookers to initialize and connect to the parent before shutting everything down, which seems add about 20sec of additional overhead for us in a fully up-to-date cook.
Can you let us know if this is an acceptable solution?