Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-224349

Attempting to save multiple debug profiles during the same second fails to properly save all but the first profile

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.17 Pre-release 1
    • 21w16a, 21w17a, 21w20a
    • None
    • Confirmed
    • Debug
    • Low

      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 more

      Additionally, 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

      1. Hold down the F3 and L keys for a few seconds (you should see "Profiling started" in chat multiple times)
      2. Check the game log
        The errors mentioned above are shown
      3. Check the debug/profiling folder
        Some .tmp files remain

            Unassigned Unassigned
            markderickson [Mod] markderickson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: