[or-cvs] r14071: Backport: Only dump all guard node status to the log when th (in tor/branches/tor-0_2_0-patches: . src/or)

nickm at seul.org nickm at seul.org
Mon Mar 17 04:08:05 UTC 2008


Author: nickm
Date: 2008-03-17 00:08:04 -0400 (Mon, 17 Mar 2008)
New Revision: 14071

Modified:
   tor/branches/tor-0_2_0-patches/
   tor/branches/tor-0_2_0-patches/ChangeLog
   tor/branches/tor-0_2_0-patches/src/or/circuitbuild.c
   tor/branches/tor-0_2_0-patches/src/or/connection.c
   tor/branches/tor-0_2_0-patches/src/or/directory.c
Log:
 r18874 at catbus:  nickm | 2008-03-17 00:07:41 -0400
 Backport: Only dump all guard node status to the log when the guard node status actually changes.  Downgrade the 4 most common remaining INFO log messages to DEBUG.



Property changes on: tor/branches/tor-0_2_0-patches
___________________________________________________________________
 svk:merge ticket from /tor/020 [r18874] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/branches/tor-0_2_0-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_2_0-patches/ChangeLog	2008-03-17 04:07:56 UTC (rev 14070)
+++ tor/branches/tor-0_2_0-patches/ChangeLog	2008-03-17 04:08:04 UTC (rev 14071)
@@ -38,7 +38,12 @@
       .in-addr.arpa addresses are passed to the DNSPort.  Part of a fix
       for bug 617. Bugfix on 0.2.0.1-alpha.
 
+  o Minor features:
+    - Only log guard node status when guard node status has changed.
+    - Downgrade the 3 most common "INFO" messages to "DEBUG".  This will make
+      "INFO" 75% less verbose.
 
+
 Changes in version 0.2.0.21-rc - 2008-03-02
   o Major bugfixes:
     - The control port should declare that it requires password auth

Modified: tor/branches/tor-0_2_0-patches/src/or/circuitbuild.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/circuitbuild.c	2008-03-17 04:07:56 UTC (rev 14070)
+++ tor/branches/tor-0_2_0-patches/src/or/circuitbuild.c	2008-03-17 04:08:04 UTC (rev 14071)
@@ -755,8 +755,8 @@
     char tmpbuf[INET_NTOA_BUF_LEN];
     in.s_addr = htonl(circ->n_addr);
     tor_inet_ntoa(&in,tmpbuf,sizeof(tmpbuf));
-    log_info(LD_CIRC|LD_OR,"Next router (%s:%d) not connected. Connecting.",
-             tmpbuf, circ->n_port);
+    log_debug(LD_CIRC|LD_OR,"Next router (%s:%d) not connected. Connecting.",
+              tmpbuf, circ->n_port);
 
     circ->n_conn_onionskin = tor_malloc(ONIONSKIN_CHALLENGE_LEN);
     memcpy(circ->n_conn_onionskin, onionskin, ONIONSKIN_CHALLENGE_LEN);
@@ -2169,7 +2169,7 @@
 {
   time_t now;
   int changed = 0;
-  int severity = LOG_INFO;
+  int severity = LOG_DEBUG;
   or_options_t *options;
   if (! entry_guards)
     return;
@@ -2182,26 +2182,28 @@
     {
       routerinfo_t *r = router_get_by_digest(entry->identity);
       const char *reason = NULL;
+      /*XXX021 log reason again. */
       if (entry_guard_set_status(entry, r, now, options, &reason))
         changed = 1;
 
       if (entry->bad_since)
         tor_assert(reason);
-
-      log_info(LD_CIRC, "Summary: Entry '%s' is %s, %s%s, and %s.",
-               entry->nickname,
-               entry->unreachable_since ? "unreachable" : "reachable",
-               entry->bad_since ? "unusable: " : "usable",
-               entry->bad_since ? reason : "",
-               entry_is_live(entry, 0, 1, 0) ? "live" : "not live");
     });
 
   if (remove_dead_entry_guards())
     changed = 1;
 
+  severity = changed ? LOG_DEBUG : LOG_INFO;
+
   if (changed) {
-    log_fn(severity, LD_CIRC, "    (%d/%d entry guards are usable/new)",
-           num_live_entry_guards(), smartlist_len(entry_guards));
+    SMARTLIST_FOREACH(entry_guards, entry_guard_t *, entry,
+        log_info(LD_CIRC, "Summary: Entry '%s' is %s, %s, and %s.",
+               entry->nickname,
+               entry->unreachable_since ? "unreachable" : "reachable",
+               entry->bad_since ? "unusable: " : "usable",
+               entry_is_live(entry, 0, 1, 0) ? "live" : "not live"));
+    log_info(LD_CIRC, "    (%d/%d entry guards are usable/new)",
+             num_live_entry_guards(), smartlist_len(entry_guards));
     log_entry_guards(LOG_INFO);
     entry_guards_changed();
   }

Modified: tor/branches/tor-0_2_0-patches/src/or/connection.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/connection.c	2008-03-17 04:07:56 UTC (rev 14070)
+++ tor/branches/tor-0_2_0-patches/src/or/connection.c	2008-03-17 04:08:04 UTC (rev 14071)
@@ -1965,14 +1965,14 @@
     switch (result) {
       case TOR_TLS_CLOSE:
       case TOR_TLS_ERROR_IO:
-        log_info(LD_NET,"TLS connection closed %son read. Closing. "
+        log_debug(LD_NET,"TLS connection closed %son read. Closing. "
                  "(Nickname %s, address %s",
                  result == TOR_TLS_CLOSE ? "cleanly " : "",
                  or_conn->nickname ? or_conn->nickname : "not set",
                  conn->address);
         return result;
       CASE_TOR_TLS_ERROR_ANY_NONIO:
-        log_info(LD_NET,"tls error [%s]. breaking (nickname %s, address %s).",
+        log_debug(LD_NET,"tls error [%s]. breaking (nickname %s, address %s).",
                  tor_tls_err_to_string(result),
                  or_conn->nickname ? or_conn->nickname : "not set",
                  conn->address);

Modified: tor/branches/tor-0_2_0-patches/src/or/directory.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/directory.c	2008-03-17 04:07:56 UTC (rev 14070)
+++ tor/branches/tor-0_2_0-patches/src/or/directory.c	2008-03-17 04:08:04 UTC (rev 14071)
@@ -2209,7 +2209,7 @@
     dlen = compressed ? d->dir_z_len : d->dir_len;
 
     if (global_write_bucket_low(TO_CONN(conn), dlen, 1)) {
-      log_info(LD_DIRSERV,
+      log_debug(LD_DIRSERV,
                "Client asked for the mirrored directory, but we've been "
                "writing too many bytes lately. Sending 503 Dir busy.");
       write_http_status_line(conn, 503, "Directory busy, try again later");
@@ -2314,7 +2314,7 @@
 
     dlen = dirserv_estimate_data_size(dir_fps, 0, compressed);
     if (global_write_bucket_low(TO_CONN(conn), dlen, 2)) {
-      log_info(LD_DIRSERV,
+      log_debug(LD_DIRSERV,
                "Client asked for network status lists, but we've been "
                "writing too many bytes lately. Sending 503 Dir busy.");
       write_http_status_line(conn, 503, "Directory busy, try again later");



More information about the tor-commits mailing list