summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--DESIGN23
1 files changed, 23 insertions, 0 deletions
diff --git a/DESIGN b/DESIGN
index f058fe0..eb5d1e1 100644
--- a/DESIGN
+++ b/DESIGN
@@ -81,6 +81,29 @@ finish a sweep in OT_CLEAN_INTERVAL_MINUTES. At the default bucket count that
81is one bucket every 117 ms. 81is one bucket every 117 ms.
82 82
83 83
84Startup and teardown order
85--------------------------
86
87Nothing that consults the access list runs before the list has been read.
88The loader used to do its first read inside its own thread, so whatever ran
89next saw an empty list: a state file read with -l was checked against it and
90a blacklist build restored torrents it should have refused, a whitelist build
91restored none at all. Announces arriving in the same window went the same
92way, 3089 of them refused over 373 ms against a two million entry whitelist.
93The first read is therefore synchronous in accesslist_init, and the thread
94only handles reloads.
95
96Teardown stops the cleaner first. It is the one worker that calls into other
97modules, accesslist_cleanup and stats_cleanup, so stopping it after them left
98it locking a mutex accesslist_deinit had already destroyed: five shutdowns in
99sixty at a bucket count low enough to make the window easy to hit.
100
101Signal handlers are installed before the first thread exists. A thread
102created earlier runs with whatever disposition a signal still has, and
103SIGUSR1, the one that wakes a blocked worker, terminates a process by
104default.
105
106
84Paths not taken 107Paths not taken
85--------------- 108---------------
86 109