The bug
Attempting to save multiple debug profiles during the same second fails to properly save more than one profile. Instead, some are left as a .tmp file, like 2021-04-27_18.28.10.tmp.
The following error is logged when attempting to save the second profile.
Caught exception in thread Thread[IO-Worker-128,5,main]
java.io.UncheckedIOException: java.nio.file.FileAlreadyExistsException: debug/profiling/2021-04-27_18.28.10.zip
at eln.a(SourceFile:129)
at eln.a(SourceFile:69)
at ele.i(SourceFile:210)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.nio.file.FileAlreadyExistsException: debug/profiling/2021-04-27_18.28.10.zip
at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:429)
at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)
at java.nio.file.Files.move(Files.java:1395)
at eln.a(SourceFile:127)
... 5 moreAdditionally, when trying to save three or more profiles in the same second, the following error appears, for every individual file that would be generated within the profile.
Could not save profiler results to /profiling.txt
java.nio.file.FileAlreadyExistsException: profiling.txt
at com.sun.nio.zipfs.ZipFileSystem.newOutputStream(ZipFileSystem.java:516)
at com.sun.nio.zipfs.ZipPath.newOutputStream(ZipPath.java:790)
at com.sun.nio.zipfs.ZipFileSystemProvider.newOutputStream(ZipFileSystemProvider.java:285)
at java.nio.file.Files.newOutputStream(Files.java:216)
at java.nio.file.Files.newBufferedWriter(Files.java:2860)
at api.a(SourceFile:164)
at eln.a(SourceFile:122)
at eln.a(SourceFile:65)
at ele.i(SourceFile:210)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)How to reproduce
Hold down the F3 and L keys for a few seconds (you should see "Profiling started" in chat multiple times)
Check the game log
❌ The errors mentioned above are shownCheck the
debug/profilingfolder
❌ Some.tmpfiles remain
This is (probably) caused by the fact that multiple debug profiles are trying to be saved under the same name. This can be fixed by appending a number to the end of the file name, like how screenshots are stored.