[tor-bugs] #13003 [Onionoo]: Figure out a better strategy to avoid concurrent Onionoo executions

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Sep 17 08:54:34 UTC 2014


#13003: Figure out a better strategy to avoid concurrent Onionoo executions
-------------------------+-----------------
     Reporter:  karsten  |      Owner:
         Type:  defect   |     Status:  new
     Priority:  normal   |  Milestone:
    Component:  Onionoo  |    Version:
   Resolution:           |   Keywords:
Actual Points:           |  Parent ID:
       Points:           |
-------------------------+-----------------

Comment (by karsten):

 Replying to [comment:12 iwakeh]:
 > Unless an ERROR was logged, I think this is normal behavior.

 Are you sure?  I explicitly added the EMAIL appender to the statistics
 logger.  I don't see where messages would be filtered based on log level.

 I also added an error log statement to the end of Main, but still don't
 receive emails.

 Here's the current diff:

 {{{
 diff --git a/bin/update.sh b/bin/update.sh
 index 9294f41..52b350f 100755
 --- a/bin/update.sh
 +++ b/bin/update.sh
 @@ -1,3 +1,3 @@
  #!/bin/bash
 -ant run >> log && cat errors
 +ant run >> log && cat onionoo-err.log

 diff --git a/build.xml b/build.xml
 index b4a9031..e37cf6d 100644
 --- a/build.xml
 +++ b/build.xml
 @@ -26,6 +26,10 @@
        <include name="logback-core.jar"/>
        <include name="slf4j-api.jar"/>
      </fileset>
 +    <fileset dir="gnumail">
 +      <include name="gnumail-1.1.2.jar"/>
 +      <include name="gnumail-providers-1.1.2.jar"/>
 +    </fileset>
      <fileset dir="deps/metrics-lib">
        <include name="descriptor.jar"/>
      </fileset>
 diff --git a/logback.xml b/logback.xml
 index f6d16d0..b801045 100644
 --- a/logback.xml
 +++ b/logback.xml
 @@ -47,8 +47,19 @@
      </filter>
    </appender>

 +  <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
 +    <smtpHost>localhost</smtpHost>
 +    <to>karsten at torproject.org</to>
 +    <from>metrics at sewerzowi.torproject.org</from>
 +    <subject>ONIONOO: %level %logger{20} - %m</subject>
 +    <layout class="ch.qos.logback.classic.PatternLayout">
 +      <pattern>${utc-date-pattern} [runtime: %r] %msg%n</pattern>
 +    </layout>
 +  </appender>
 +
    <logger name="org.torproject" >
      <appender-ref ref="FILEERR" />
 +    <appender-ref ref="EMAIL" />
    </logger>
    <logger name="org.torproject.onionoo.cron.Main" >
      <appender-ref ref="FILESTATISTICS" />
 @@ -57,6 +68,7 @@
    <!-- a named logger -->
    <logger name="statistics" >
      <appender-ref ref="FILESTATISTICS" />
 +    <appender-ref ref="EMAIL" />
    </logger>

    <root level="ALL">
 diff --git a/src/main/java/org/torproject/onionoo/cron/Main.java
 b/src/main/java/org/torproject/onionoo/cron/Main.java
 index d9cb1b1..16b7cc1 100644
 --- a/src/main/java/org/torproject/onionoo/cron/Main.java
 +++ b/src/main/java/org/torproject/onionoo/cron/Main.java
 @@ -74,7 +74,7 @@ public class Main {
            + "execution may not start as expected");
      }

 -    log.info("Terminating.");
 +    log.error("Terminating.");
    }
  }
 }}}

 > If the stat-log should be mailed, too, [...]

 No, this is just for testing.

 > PS:
 > I usually have an error immediatly after starting {{{ant run}}}, b/c I
 still do not have the
 > correct geoip setup. Is the documentation already updated or should I
 open a ticket?

 Oops.  Please find the updated INSTALL file in master.

 > In addition, I usually have time-out errors during the run.

 Can you be more specific, ideally in a new ticket?

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


More information about the tor-bugs mailing list