Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Issue Boards

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #20320

Closed (moved)
Open
Opened Oct 08, 2016 by Karsten Loesing@karsten

Avoid running into an IOException and logging a warning for it

When we recently switched from System.err printing to slf4j logging, we started logging an IOException that we shouldn't be running into and that we simply ignored before. This exception gets thrown when DescriptorReaderImpl attempts to read a parse history file that doesn't exist (yet). We should simply check whether that files exists before attempting to read it. Trivial patch:

diff --git a/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java b/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java
index fac9475..020cdd7 100644
--- a/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java
@@ -200,7 +200,7 @@ public class DescriptorReaderImpl implements DescriptorReader {
     }
 
     private void readOldHistory() {
-      if (this.historyFile == null) {
+      if (this.historyFile == null || !this.historyFile.exists()) {
         return;
       }
       try {

I'd say this is a minor issue, because it prints a warning message that might confuse users, but only on the first run. No need to put out a (point) release just for this, but it would be good to fix this in master.

To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
metrics-lib 1.5.0
Milestone
metrics-lib 1.5.0
Assign milestone
Time tracking
None
Due date
None
Reference: legacy/trac#20320