Opened 7 years ago

Closed 15 months ago

#7676 closed enhancement (wontfix)

Add resume support for tests

Reported by: ioerror Owned by: hellais
Priority: Medium Milestone:
Component: Archived/Ooni Version:
Severity: Normal Keywords: ooni_wishlist, archived-closed-2018-07-04
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

It appears that the resume support isn't thread safe - if one has multiple tests running, we don't store the state or an identifier of the test in the resume file (ooniprobe.resume). This means that any number of tests running from a deck will be impossible to resume - we should probably hash the arguments to make a unique but easy to collide with identifier - then we can store the state of each unique call, even for multiple runs of the same test.

Child Tickets

Change History (6)

comment:1 Changed 7 years ago by hellais

Priority: majornormal
Type: defectenhancement

Yes, this is a limitation of the current resume support functionality, though it has nothing to do with thread safety.

Thread safety has to do with the manipulation of in memory data structures from multiple threads at the same time. Most tests (the only exceptions are captive portal and netalyzr) do not even run in separate threads.

Ideally though you should not have multiple instances of the same test be running at the same time. There should only be one instance of every test at any given time.

It should be possible to extend the test inputs to support your need for having multiple inputs without requiring to have more than one test at the same time.

For example in here:
https://trac.torproject.org/projects/tor/ticket/7664#comment:2

you should not have various different lists of DNS hostnames to lookup. Instead the list you give as input should be prioritized in the order in which you want the scan to occur.

Also the resume support is *very* hackish and was just a quick way of getting it done. What we should have in the future (when we have the ooniprobe API) is the ability to keep track of state in memory and save it to database when the reactor is about to get killed by serializing the in-memory data structure that stores it.

comment:2 Changed 7 years ago by hellais

Keywords: ooni_wishlist added

comment:3 Changed 7 years ago by ioerror

I mean - the key is that a single deck will break the resume support; that is why I mention thread support. If decks can only run one test of one kind, we shouldn't allow it to run.

comment:4 Changed 5 years ago by hellais

Summary: resume supportAdd resume support for tests

comment:5 Changed 22 months ago by teor

Severity: Normal

Set all open tickets without a severity to "Normal"

comment:6 Changed 15 months ago by teor

Keywords: archived-closed-2018-07-04 added
Resolution: wontfix
Status: newclosed

Close all tickets in archived components

Note: See TracTickets for help on using tickets.