Skip to content
Snippets Groups Projects

Ignore running flag

Merged meskio requested to merge meskio/rdsys:ignore_running into main
2 unresolved threads

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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.

  • Please register or sign in to reply
  • onyinyang
  • 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 }
    • I see that it was previously used to determine the fraction of running bridges but then acted on that value. Still, maybe it's useful to know what the fraction is for some reason?

    • Please register or sign in to reply
  • Author Owner

    I'm not sure if the running bridges ratio will be useful, but when in doubt let me create a metric for that and add it in this merge request.

  • meskio added 4 commits

    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

    Compare with previous version

  • Author Owner

    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?

  • It took me a while to wrap my head around what you were trying to do but I think it makes sense :smile: Let's try it and see what happens :laughing:

  • onyinyang approved this merge request

    approved this merge request

  • merged

  • Please register or sign in to reply
    Loading