[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r16480: {tor} Rate-limit "too-many-sockets" messages; they can get needles (in tor/trunk: . src/or)



Author: nickm
Date: 2008-08-09 11:35:37 -0400 (Sat, 09 Aug 2008)
New Revision: 16480

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/connection.c
Log:
Rate-limit "too-many-sockets" messages; they can get needlessly verbose.

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2008-08-09 15:13:28 UTC (rev 16479)
+++ tor/trunk/ChangeLog	2008-08-09 15:35:37 UTC (rev 16480)
@@ -18,7 +18,11 @@
       when building against recent kernels.  Bugfix on 0.1.2.1-alpha.
     - Add a missing safe_str() call for a debug log message.
 
+  o Minor features
+    - Rate-limit too-many-sockets messages: when they happen, they
+      happen a lot.  Resolves bug 748.
 
+
 Changes in version 0.2.1.4-alpha - 2008-08-04
   o Major bugfixes:
     - The address part of exit policies was not correctly written

Modified: tor/trunk/src/or/connection.c
===================================================================
--- tor/trunk/src/or/connection.c	2008-08-09 15:13:28 UTC (rev 16479)
+++ tor/trunk/src/or/connection.c	2008-08-09 15:35:37 UTC (rev 16480)
@@ -762,8 +762,8 @@
 {
 #define WARN_TOO_MANY_CONNS_INTERVAL (6*60*60)
   time_t last_warned = 0, now = time(NULL);
+  int n_conns = get_n_open_sockets();
   if (last_warned + WARN_TOO_MANY_CONNS_INTERVAL < now) {
-    int n_conns = get_n_open_sockets();
     log_warn(LD_NET,"Failing because we have %d connections already. Please "
              "raise your ulimit -n.", n_conns);
     last_warned = now;