Opened 8 years ago

Closed 8 years ago

#6953 closed defect (fixed)

(relays|bridges)_published in Pyonionoo should not depend on relays/bridges contained in result

Reported by: karsten Owned by: gsathya
Priority: Medium Milestone:
Component: pyonionoo Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Right now, (relays|bridges)_published in Pyonionoo contains the latest timestamp of relays/bridges contained in the result. If there are no bridges/relays, the respective published time is 1900-01-01. If the returned bridges/relays were not offline for a few hours, that time is returned as published time.

I admit that the Onionoo protocol specification was imprecise there by specifying what's currently implemented in Pyonionoo. But the current Onionoo behavior makes more sense for clients. Tweaked the specification.

The (relays|bridges)_published fields should contain the timestamps when the last consensus known to Onionoo/Pyonionoo became valid and when the last known bridge network status was published.

Child Tickets

Change History (7)

comment:1 Changed 8 years ago by gsathya

Component: Onionoopyonionoo
Owner: set to gsathya

comment:2 in reply to:  description ; Changed 8 years ago by gsathya

Cc: gsathya removed
Status: newneeds_information

Replying to karsten:

The (relays|bridges)_published fields should contain the timestamps when the last consensus known to Onionoo/Pyonionoo became valid and when the last known bridge network status was published.

Does the summary document contain this information? Otherwise the only way I can think of currently to get this info is the parse the consensus document.

comment:3 in reply to:  2 ; Changed 8 years ago by karsten

Replying to gsathya:

Does the summary document contain this information? Otherwise the only way I can think of currently to get this info is the parse the consensus document.

It does. The last timestamp of all "r" lines is the relays_published timestamp and the last timestamp of all "b" lines is bridges_published. No need to parse any other documents for that.

comment:4 in reply to:  3 ; Changed 8 years ago by gsathya

Replying to karsten:

Replying to gsathya:

Does the summary document contain this information? Otherwise the only way I can think of currently to get this info is the parse the consensus document.

It does. The last timestamp of all "r" lines is the relays_published timestamp and the last timestamp of all "b" lines is bridges_published. No need to parse any other documents for that.

Aha! I'm wondering how expensive it would be to do another separate db query for this, or just figure this out while inserting data into the db?

comment:5 in reply to:  4 ; Changed 8 years ago by karsten

Replying to gsathya:

Replying to karsten:

Replying to gsathya:

Does the summary document contain this information? Otherwise the only way I can think of currently to get this info is the parse the consensus document.

It does. The last timestamp of all "r" lines is the relays_published timestamp and the last timestamp of all "b" lines is bridges_published. No need to parse any other documents for that.

Aha! I'm wondering how expensive it would be to do another separate db query for this, or just figure this out while inserting data into the db?

I'd say just make another database query for this. Doing anything past the database is subject to breaking sooner or later.

comment:6 in reply to:  5 Changed 8 years ago by gsathya

Status: needs_informationneeds_review

Replying to karsten:

I'd say just make another database query for this. Doing anything past the database is subject to breaking sooner or later.

Done. Please review my bug_6953 branch! Thanks!

comment:7 Changed 8 years ago by karsten

Resolution: fixed
Status: needs_reviewclosed

Looks good, merged. Closing. Thanks!

Note: See TracTickets for help on using tickets.