diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-05 16:06:27 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-05 16:06:27 +0100 |
| commit | 42806212195e30f298d4c9354d56442393bb38a5 (patch) | |
| tree | 594b4930748973e51856e3423e10b4c4ae82a25a /DESIGN | |
| parent | ee765f1469ecb4ac666139340928f35b39926f36 (diff) | |
Start describing design considerations for the startup (and teardown) order
Diffstat (limited to 'DESIGN')
| -rw-r--r-- | DESIGN | 23 |
1 files changed, 23 insertions, 0 deletions
| @@ -81,6 +81,29 @@ finish a sweep in OT_CLEAN_INTERVAL_MINUTES. At the default bucket count that | |||
| 81 | is one bucket every 117 ms. | 81 | is one bucket every 117 ms. |
| 82 | 82 | ||
| 83 | 83 | ||
| 84 | Startup and teardown order | ||
| 85 | -------------------------- | ||
| 86 | |||
| 87 | Nothing that consults the access list runs before the list has been read. | ||
| 88 | The loader used to do its first read inside its own thread, so whatever ran | ||
| 89 | next saw an empty list: a state file read with -l was checked against it and | ||
| 90 | a blacklist build restored torrents it should have refused, a whitelist build | ||
| 91 | restored none at all. Announces arriving in the same window went the same | ||
| 92 | way, 3089 of them refused over 373 ms against a two million entry whitelist. | ||
| 93 | The first read is therefore synchronous in accesslist_init, and the thread | ||
| 94 | only handles reloads. | ||
| 95 | |||
| 96 | Teardown stops the cleaner first. It is the one worker that calls into other | ||
| 97 | modules, accesslist_cleanup and stats_cleanup, so stopping it after them left | ||
| 98 | it locking a mutex accesslist_deinit had already destroyed: five shutdowns in | ||
| 99 | sixty at a bucket count low enough to make the window easy to hit. | ||
| 100 | |||
| 101 | Signal handlers are installed before the first thread exists. A thread | ||
| 102 | created earlier runs with whatever disposition a signal still has, and | ||
| 103 | SIGUSR1, the one that wakes a blocked worker, terminates a process by | ||
| 104 | default. | ||
| 105 | |||
| 106 | |||
| 84 | Paths not taken | 107 | Paths not taken |
| 85 | --------------- | 108 | --------------- |
| 86 | 109 | ||
