Large PGN files will accept download request before PGN write is complete.
When doing datagen and the test just completed, I can request to download the PGN file.
The file will begin downloading although the PGN file hasn't finished being written yet.
This results in an incomplete download.
This issue could also occur when attempting to download a PGN during a currently running test, I imagine.
Its hard to give a safe answer here. I don't want to lock the server's PGN file when someone is downloading. But its hard to say when its "safe" to download the file. In general, that is ~ 1 minute after the workload finishes. Because at that point, all workers will exit their workloads, and upload their PGNs.
You may have also noticed that the # of PGNs in the archive does not match the value displayed on the test. That is also a hard problem to solve.
Is it possible to only allow downloading the PGN after 1 minutes after the test completes?
Number of PGN's in the archive doesn't bother anyone I expect, but downloading a partial file with no warning at all that's it's a partial file can get someone.
Part of the # of PGNs being off, also means having incomplete pairs. Which for datagen does not matter at all. But this could be annoying/weird for other cases. This is something I can aim to fix when swapping to Fastchess.
As for the time limit on the downloads... I could probably do that. Return an error JSON and say "PGNs cannot be downloaded until ... after the workload has finished". Might not actually have timestamps for a workload being "finished" though.
Resolved in the dev branch via https://github.com/AndyGrant/OpenBench/commit/714b0c9942bd1d402147997910e5524efa0c0384 . Will be merged into master at some unknown time in the future.