Ignore running flag
We already test bridges both with bridgestrap and onbasca. Some bridges might be working fine, but not have the running flag if it's ORPort is not reachable.
Closes: #154 (closed)
Merge request reports
Activity
assigned to @meskio
requested review from @onyinyang
344 332 b.Flags.Running = status.Flags.Running 345 333 b.Flags.Valid = status.Flags.Valid 346 334 347 //check to see if the bridge has the running flag 348 if status.Flags.Running { 349 bridges[b.Fingerprint] = b 350 runningBridges++ 351 } else { 352 log.Printf("Found bridge %s in networkstatus but is not running", b.Fingerprint) 353 } I am mostly ignorant about how all of this works but I'm wondering if it might still be useful to keep track of the bridges that are running for measurement purposes? Perhaps this happens somewhere else, and you're still right to move
bridges[b.Fingerprint]=b
outside of the conditional in any case.
349 bridges[b.Fingerprint] = b 350 runningBridges++ 351 } else { 352 log.Printf("Found bridge %s in networkstatus but is not running", b.Fingerprint) 353 } 335 bridges[b.Fingerprint] = b 354 336 numBridges++ 355 337 } 356 357 runningBridgesFraction := float64(runningBridges) / float64(numBridges) 358 if runningBridgesFraction < MinFunctionalFraction { 359 // Fail if most bridges are marked as non-functional. This happens if bridge authority restarts (#102) 360 // XXX: If bridge authority restarts at the same time than rdsys the first update will not get any 361 // bridges, hopefully this will not happend. 362 return nil, NotEnoughRunningError 363 } added 4 commits
-
3b9bda8e...f3a62766 - 2 commits from branch
tpo/anti-censorship:main
- f16ca698 - Ignore running flag
- 6f504c40 - Metric for resources with their functionality, ratio and Running
-
3b9bda8e...f3a62766 - 2 commits from branch
Looking at metrics I tried to create something more versatile and replace the state/ratio fraction metrics with a counter of resources with labels (I hope TPA will not get angry as this will produce a bunch of comvinations with the labels).
With this we can calculate the fractions that we were using, but we also look at things like: how many bridges don't have the running flag but are functional?
Not sure if I'm trying to make something too generic and I'm complicating things. @onyinyang what do you think?