[metrics-bugs] #24153 [Metrics/Library]: Make DescriptorCollector resume previously aborted downloads

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Nov 6 08:11:25 UTC 2017


#24153: Make DescriptorCollector resume previously aborted downloads
---------------------------------+--------------------------
     Reporter:  karsten          |      Owner:  metrics-team
         Type:  defect           |     Status:  new
     Priority:  Medium           |  Milestone:
    Component:  Metrics/Library  |    Version:
     Severity:  Normal           |   Keywords:
Actual Points:                   |  Parent ID:
       Points:                   |   Reviewer:
      Sponsor:                   |
---------------------------------+--------------------------
 Today I noticed that `DescriptorCollector` skips files when it runs into a
 temporary file from a previously aborted download. Example:

 {{{
 [WARN] Cannot fetch remote file server-descriptors-2017-10.tar.xz from
 https://collector.torproject.org.  Skipping that file.
 java.nio.file.FileAlreadyExistsException: backup/archive/relay-descriptors
 /server-descriptors/.server-descriptors-2017-10.tar.xz
         at
 sun.nio.fs.UnixException.translateToIOException(UnixException.java:88)
         at
 sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
         at
 sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
         at
 sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
         at
 java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434)
         at java.nio.file.Files.newOutputStream(Files.java:216)
         at java.nio.file.Files.copy(Files.java:3016)
         at
 org.torproject.descriptor.index.DescriptorIndexCollector.fetchRemoteFiles(DescriptorIndexCollector.java:123)
         at
 org.torproject.descriptor.index.DescriptorIndexCollector.collectDescriptors(DescriptorIndexCollector.java:83)
         at Archive.main(Archive.java:12)
 }}}

 This is rather unexpected. The main reason for using a temporary file is
 to avoid overwriting an existing file and risking to leave the user with
 only a broken file if the download gets interrupted. But the temporary
 file should not prevent us from making a download that may succeed.

 Let's change the behavior here to delete any temporary files we run into
 or simply overwriting them.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/24153>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the metrics-bugs mailing list