[or-cvs] [tor/master 2/7] Don't spam controllers with TOO_MANY_CONNECTIONS events

nickm at torproject.org nickm at torproject.org
Tue Feb 9 18:01:50 UTC 2010


Author: Sebastian Hahn <sebastian at torproject.org>
Date: Sun, 31 Jan 2010 21:54:04 +0100
Subject: Don't spam controllers with TOO_MANY_CONNECTIONS events
Commit: b2b99a70c005ae4158786d0c30b35dc6db45e9b6

We implemented ratelimiting for warnings going into the logfile, but didn't
rate-limit controller events. Now both log warnings and controller events
are rate-limited.
---
 ChangeLog           |    3 +++
 src/or/connection.c |    4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 339402b..476c217 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,9 @@ Changes in version 0.2.2.9-alpha - 2010-??-??
     - Actually reject .exit hostnames when we're supposed to be rejecting
       them; do not pass them on to the exit server.  Bugfix on 0.2.2.7-alpha;
       found and diagnosed by Scott Bennett and Downie on or-talk.
+    - Don't spam the controller with log messages when we have no file
+      descriptors available. Rate-limiting for log messages was already
+      implemented in the past.
 
   o Code simplifications and refactoring:
     - Generate our manpage and HTML documentation using Asciidoc.  This
diff --git a/src/or/connection.c b/src/or/connection.c
index eeb25c1..cf13345 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -822,9 +822,9 @@ warn_too_many_conns(void)
     log_warn(LD_NET,"Failing because we have %d connections already. Please "
              "raise your ulimit -n.", n_conns);
     last_warned = now;
+    control_event_general_status(LOG_WARN, "TOO_MANY_CONNECTIONS CURRENT=%d",
+                                 n_conns);
   }
-  control_event_general_status(LOG_WARN, "TOO_MANY_CONNECTIONS CURRENT=%d",
-                               n_conns);
 }
 
 /** Bind a new non-blocking socket listening to the socket described
-- 
1.6.5




More information about the tor-commits mailing list