Chunk Generation was occuring while inside of the progressCache lock this caused the progressCache to stay blocked for a long period of time which then blocked main when main needed to clean the expiring map. We now maintain a separate map for pending scheduler entries, that we can join on if a 2nd request comes in while one is starting. This strategy keeps the lock only for a fraction of time but maintains thread safety. So now the chunk is generated without holding a lock and wont block the main thread on the expiring map as we will insert it once ready.
96 KiB
96 KiB