[or-cvs] r18538: {torctl} Demote some warns in the case of timeout. (torctl/trunk/python/TorCtl)
mikeperry at seul.org
mikeperry at seul.org
Sat Feb 14 08:57:15 UTC 2009
Author: mikeperry
Date: 2009-02-14 03:57:15 -0500 (Sat, 14 Feb 2009)
New Revision: 18538
Modified:
torctl/trunk/python/TorCtl/PathSupport.py
torctl/trunk/python/TorCtl/StatsSupport.py
Log:
Demote some warns in the case of timeout.
Modified: torctl/trunk/python/TorCtl/PathSupport.py
===================================================================
--- torctl/trunk/python/TorCtl/PathSupport.py 2009-02-14 01:02:45 UTC (rev 18537)
+++ torctl/trunk/python/TorCtl/PathSupport.py 2009-02-14 08:57:15 UTC (rev 18538)
@@ -1310,9 +1310,11 @@
self.streams[s.strm_id] = Stream(s.strm_id, s.target_host,
s.target_port, "NEW")
# FIXME Stats (differentiate Resolved streams also..)
- # XXX: This can happen for timeouts
if not s.circ_id:
- plog("WARN", "Stream "+str(s.strm_id)+" detached from no circuit!")
+ if s.reason == "TIMEOUT":
+ plog("NOTICE", "Stream "+str(s.strm_id)+" detached with timeout.")
+ else:
+ plog("WARN", "Stream "+str(s.strm_id)+" detachached from no circuit with reason: "+str(s.reason))
else:
self.streams[s.strm_id].detached_from.append(s.circ_id)
@@ -1349,7 +1351,10 @@
# XXX: Can happen on timeout
if not s.circ_id:
- plog("WARN", "Stream "+str(s.strm_id)+" failed from no circuit!")
+ if s.reason == "TIMEOUT":
+ plog("NOTICE", "Stream "+str(s.strm_id)+" detached with timeout.")
+ else:
+ plog("WARN", "Stream "+str(s.strm_id)+" detachached from no circuit with reason: "+str(s.reason))
# We get failed and closed for each stream. OK to return
# and let the closed do the cleanup
Modified: torctl/trunk/python/TorCtl/StatsSupport.py
===================================================================
--- torctl/trunk/python/TorCtl/StatsSupport.py 2009-02-14 01:02:45 UTC (rev 18537)
+++ torctl/trunk/python/TorCtl/StatsSupport.py 2009-02-14 08:57:15 UTC (rev 18538)
@@ -614,9 +614,12 @@
if (s.status in ("DETACHED", "FAILED", "CLOSED", "SUCCEEDED")
and not s.circ_id):
# XXX: REMAPs can do this (normal). Also REASON=DESTROY (bug?)
- # Also timeouts.. Those should use the pending circ instead
+ # XXX: Timeouts should count failure on the pending circ instead
# of returning..
- plog("WARN", "Stream "+str(s.strm_id)+" detached from no circuit!")
+ if s.reason == "TIMEOUT":
+ plog("NOTICE", "Stream "+str(s.strm_id)+" detached with timeout.")
+ else:
+ plog("WARN", "Stream "+str(s.strm_id)+" detachached from no circuit with reason: "+str(s.reason))
PathBuilder.stream_status_event(self, s)
return
More information about the tor-commits
mailing list