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

[tor-commits] [onionoo/release] Remove disappearing family members.



commit 941ffd691b7ddaa7d4ae692746f056bcabdfc1d7
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Mon Nov 11 10:59:13 2019 +0100

    Remove disappearing family members.
    
    When a relay stops writing any family members into its server
    descriptor we never cleared old family members but kept them forever.
    We should do that.
    
    Fixes #28314.
---
 CHANGELOG.md                                                       | 7 +++++++
 .../metrics/onionoo/updater/NodeDetailsStatusUpdater.java          | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index b5c4c38..dc93ec6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+# Changes in version 7.0-1.2?.? - 2019-1?-??
+
+ * Medium changes
+   - Remove declared/alleged family members after they disappear from
+     server descriptors.
+
+
 # Changes in version 7.0-1.21.1 - 2019-11-09
 
  * Minor changes
diff --git a/src/main/java/org/torproject/metrics/onionoo/updater/NodeDetailsStatusUpdater.java b/src/main/java/org/torproject/metrics/onionoo/updater/NodeDetailsStatusUpdater.java
index a5f16e4..b25459d 100644
--- a/src/main/java/org/torproject/metrics/onionoo/updater/NodeDetailsStatusUpdater.java
+++ b/src/main/java/org/torproject/metrics/onionoo/updater/NodeDetailsStatusUpdater.java
@@ -172,8 +172,8 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
     detailsStatus.setExitPolicy(descriptor.getExitPolicyLines());
     detailsStatus.setContact(descriptor.getContact());
     detailsStatus.setPlatform(descriptor.getPlatform());
+    SortedSet<String> declaredFamily = new TreeSet<>();
     if (descriptor.getFamilyEntries() != null) {
-      SortedSet<String> declaredFamily = new TreeSet<>();
       for (String familyMember : descriptor.getFamilyEntries()) {
         if (familyMember.startsWith("$") && familyMember.length() >= 41) {
           declaredFamily.add(
@@ -182,8 +182,8 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
           declaredFamily.add(familyMember);
         }
       }
-      this.declaredFamilies.put(fingerprint, declaredFamily);
     }
+    this.declaredFamilies.put(fingerprint, declaredFamily);
     if (descriptor.getIpv6DefaultPolicy() != null
         && (descriptor.getIpv6DefaultPolicy().equals("accept")
         || descriptor.getIpv6DefaultPolicy().equals("reject"))



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits