aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-dirserver/src/mirror/operation
Commit message (Collapse)AuthorAgeFilesLines
* Much formatting churn for 2024 editionIan Jackson2026-07-221-1/+1
|
* tor-dirserver: Add retry logic POC TODOClara Engler2026-03-091-0/+4
| | | | | Adds a small TODO with regard to a potentially broken retry logic in the proof-of-concept.
* tor-dirserver: Move POC to own moduleClara Engler2026-03-091-0/+87
| | | | | This commit moves dirserver POC code to an own module to semantically indicate it is not production ready.
* tor-dirserver: Remove download moduleClara Engler2026-03-091-365/+0
| | | | | This commit removes the download manager module because it does not fit well into the mental model of our current finite state machine anymore.
* tor-dirserver: Make downloader statelessClara Engler2026-01-201-42/+41
| | | | | | | | | | | | | | | | | | | This commit makes the downloader found in `mirror::operation::download` stateless by removing the `preferred_authority` field and changing all methods from `&mut self` to `&self`. The preferred authority is now accepted as a parameter to `DownloadManager::download` which also returns a tuple now with the actually used authority alongside the response, putting the management of this to the responsibility of the caller. Meanwhile, it also renames the structure from `ConsensusBoundDownloader` to `DownloadManager` because it no longer keeps a state that invalidates after a consensus "ends". The purpose of this is to simplify overall state in order to make the implementation of a finite-state-machine for the dirmirror operation more easy (and deterministic).
* Fix flaky `request_fail_ultimately` testClara Engler2026-01-191-1/+10
| | | | | | | | | | | | | This commit fixes the flaky `request_fail_ultimately` in tor-dirserver, which is flaky due to the operating system's handling of TCP RSTs, which are generally detected stochastically and sometimes are not received even after the entire response has been parsed. This leads to tor-dirclient either returning a connection reset or a truncated header error, depending on whether it successfully or unsuccessfully reads zero bytes from the server. Fixes #2318
* tor-dirserver: Speedup tests using tokio's test-utilClara Engler2026-01-141-8/+6
| | | | | | | | | | | | | | | | | | | | | This commit speeds up the tests in `tor-dirserver` by using functionality from Tokio's `test-util`. Most notably, it runs the time intensive test in paused mode, which means that the clock gets advanced either explicitly or implicitly using auto-advance in case the runtime has nothing to do. In our case, the last one, auto-advancing, is used, leading to our sleep calls returning immediately. This is good enough for testing in this module. It is not the responsibility of tor-dirserver to ensure whether `RetryDelay` returns proper values, as this is the responsibility of `tor-basic-utils`. Still, it is a bit unfortunate that Tokio offers no way to manually disbale the auto-advancing. In the future, it might be useful to migrate more parts of this to crate to `tor-rtcompat`, but for now, this change is a good enough performance fix.
* tor-dirserver: Remove slow ineffective testClara Engler2026-01-141-27/+0
| | | | | | | | | | This commit removes `mirror::download::test::request_fail_timeout` which takes more than five seconds (due to a timeout) and is generally ineffective in what it does, because testing whether a task is still sleeping after a certain time is not super trivial with the tools Tokio offers. All this test offers is testing that we enter a timeout at all.
* fix(download): Use push_timed with mockable time sourcesNihal2025-12-171-2/+2
|
* tor-dirserver: Document nested round-robinsClara Engler2025-12-101-2/+15
|
* tor-dirserver: Improve download_single's docClara Engler2025-12-101-5/+2
|
* tor-dirserver: Rename DownloadManager to ConsensusBoundDownloaderClara Engler2025-12-101-13/+13
|
* tor-dirclient: Remove Downloadable for goodClara Engler2025-12-101-4/+4
|
* tor-dirserver: Documentation improvementsClara Engler2025-12-101-3/+5
|
* tor-dirserver: Replace IO with TcpConnect errorClara Engler2025-12-101-1/+7
| | | | | | | | This commit replaces `AuthorityCommunicationError::IO` with `AuthorityCommunicationError::TcpConnect` while removing the respective `From<std::io::Error>` implementation, mostly because an IO error is way too generic and in our case, it would only occurr with a failed TCP connection.
* tor-dirserver: Fix wrong warning sectionClara Engler2025-12-101-1/+1
|
* tor-dirserver: Implement DownloadManagerClara Engler2025-12-101-0/+368
This commit implements the DownloadManager in its own module, an object responsible for downloading network documents from an upstream directory authority. Further motivation for this can be found in the rustdoc comment of the respectively introduced type.