-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f5fc8c4
commit d60a045
Showing
2 changed files
with
137 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# Architecture | ||
|
||
Once a run is confirmed, scans get initialized in parallel. Each scan instance receives their portion of the site list. | ||
|
||
```mermaid | ||
stateDiagram-v2 | ||
[*] --> ConfirmRun | ||
state fork1 <<fork>> | ||
ConfirmRun --> fork1 | ||
fork1 --> BadgerInit1 | ||
fork1 --> BadgerInit2 | ||
fork1 --> BadgerInitN | ||
state InitScans { | ||
cr1: CreateDroplet | ||
cr2: CreateDroplet | ||
cr3: CreateDroplet | ||
dep1: InstallDependencies | ||
dep2: InstallDependencies | ||
dep3: InstallDependencies | ||
sta1: StartScan | ||
sta2: StartScan | ||
sta3: StartScan | ||
state BadgerInit1 { | ||
[*] --> cr1 | ||
cr1 --> dep1 | ||
dep1 --> UploadSiteList1 | ||
UploadSiteList1 --> sta1 | ||
sta1 --> [*] | ||
} | ||
-- | ||
state BadgerInit2 { | ||
[*] --> cr2 | ||
cr2 --> dep2 | ||
dep2 --> UploadSiteList2 | ||
UploadSiteList2 --> sta2 | ||
sta2 --> [*] | ||
} | ||
-- | ||
state BadgerInitN { | ||
[*] --> cr3 | ||
cr3 --> dep3 | ||
dep3 --> UploadSiteListN | ||
UploadSiteListN --> sta3 | ||
sta3 --> [*] | ||
} | ||
} | ||
state join1 <<join>> | ||
BadgerInit1 --> join1 | ||
BadgerInit2 --> join1 | ||
BadgerInitN --> join1 | ||
join1 --> [*] | ||
``` | ||
|
||
The run is now resumable. Scans are checked for progress and status (errored/stalled/complete) in parallel. | ||
|
||
- If a scan fails, its instance is deleted and the scan gets reinitialized. | ||
- When a scan fails to progress long enough, it is considered stalled. Stalled scans get restarted, which mostly means they get to keep going after skipping the site they got stuck on. | ||
- When a scan finishes, the results are extracted and the instance is deleted. | ||
|
||
This continues until all scans finish. | ||
|
||
```mermaid | ||
stateDiagram-v2 | ||
[*] --> PollForStatus | ||
state fork2 <<fork>> | ||
PollForStatus --> fork2 | ||
fork2 --> CheckBadgerScan1 | ||
fork2 --> CheckBadgerScan2 | ||
fork2 --> CheckBadgerScanN | ||
state ManageInProgressScans { | ||
err1: CheckForFailure | ||
err2: CheckForFailure | ||
err3: CheckForFailure | ||
pro1: ExtractProgress | ||
pro2: ExtractProgress | ||
pro3: ExtractProgress | ||
sta1: CheckForStall | ||
sta2: CheckForStall | ||
sta3: CheckForStall | ||
state CheckBadgerScan1 { | ||
[*] --> err1 | ||
err1 --> pro1 | ||
pro1 --> sta1 | ||
sta1 --> [*] | ||
} | ||
-- | ||
state CheckBadgerScan2 { | ||
[*] --> err2 | ||
err2 --> pro2 | ||
pro2 --> sta2 | ||
sta2 --> [*] | ||
} | ||
-- | ||
state CheckBadgerScanN { | ||
[*] --> err3 | ||
err3 --> pro3 | ||
pro3 --> sta3 | ||
sta3 --> [*] | ||
} | ||
} | ||
state join2 <<join>> | ||
CheckBadgerScan1 --> join2 | ||
CheckBadgerScan2 --> join2 | ||
CheckBadgerScanN --> join2 | ||
state check1 <<choice>> | ||
join2 --> check1 | ||
check1 --> PrintProgress : One or more scans still running | ||
check1 --> MergeResults : All scans finished | ||
PrintProgress --> PollForStatus | ||
MergeResults --> [*] | ||
``` | ||
|
||
On completion scan results are merged by Privacy Badger as if each result was manually imported on the Manage Data tab on Privacy Badger's options page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters