[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Solved? (was: Pinging?)
Hi,
looks much better now:
* the ping scheduler was storing a binary string in lower case,
so the stored and later checked paths didn't match up. => Only
pings along those nodes were actually queued, whose identity
key digest happened to not contain any upper case letters.
* the ping generator asked the client directory about a path
along a given descriptor, even if the descriptor was not yet
valid. The descriptor was then discarded (internally) by the
directory and a random valid descriptor was returned instead
=> pings were sent along wrong paths.
Pinging now seems to work, I've created two patches. Please have
a look at them and tell me your feedback. Thanks.
===== Beginn =====
--- ClientDirectory.py (old)
+++ ClientDirectory.py (new)
@@ -1159,8 +1159,8 @@
if name.isValidFrom(startAt, endAt):
return name
else:
- LOG.error("Server is not currently valid")
- return None
+ LOG.debug("Time-invalid descriptor for %s, looking for another one.", name.getNickname())
+ name=name.getNickname()
self.__scanAsNeeded()
# If it's a nickname, return a serverinfo with that name.
===== Ende =====
===== Beginn =====
--- Pinger.py (old)
+++ Pinger.py (new)
@@ -1193,6 +1193,7 @@
assert (path2[-1].getIdentityDigest() ==
self.keyring.getIdentityKeyDigest())
try:
+ LOG.debug("Pinger checking path %s",",".join([s.getNickname() for s in (path1+path2[:-1])]))
p1 = self.directory.getPath(path1)
p2 = self.directory.getPath(path2)
except UIError, e:
@@ -1259,7 +1260,6 @@
if now is None: now = int(time.time())
periodStart = self._getPeriodStart(now)
periodEnd = periodStart + self._period_length
- path = tuple([ p.lower() for p in path ])
interval = self._getPingInterval(path)
perturbation = self._getPerturbation(path, periodStart, interval)
@@ -1410,6 +1410,7 @@
when = self.nextPingTime.get((id1,id2))
if when is None:
# No ping scheduled; server must be new to directory.
+ LOG.debug("No ping scheduled; server must be new to directory.")
self._schedulePing((id1,id2),now)
continue
elif when > now: # Not yet.
===== Ende =====
Ciao
Tobias
--
mbox:admin@tainaron