Skip to content

Conversation

@davepacheco
Copy link
Collaborator

tl;dr for reviewers: this change is mostly just code movement. The one non-movement change I made (which is still pretty trivial) was changing the return type of ZoneInvoker::get_zones() from ArchiveLogsError to ZoneError. This was just a change to the return type -- nothing else changed because we already had a conversion from ZoneError to ArchiveLogsError that callers who wanted that can use.


My goal with this PR is to clarify the structure within the DebugCollector. Today, there's a chain of several things that work together: DebugCollectorTask is a tokio task that takes requests from the rest of sled agent and uses DebugCollector (which is really a handle) to send them to DebugCollectorWorker (which does all the work) and wait for responses. This was split into two modules at the top level of sled-agent/config-reconciler:

  • debug_collector_task.rs: contains DebugCollectorTask and a related struct FormerZoneRootArchiver. These are sort of the external interface to the debug collector.
  • debug_collector.rs: contains the DebugCollector (handle), the DebugCollectorWorker (which does all the real work), all the tests, and a bunch of helper traits and impls that are mainly used for dependency injection

I've separated things differently here. First, from the parent crate's perspective, this is now all consolidated into one debug_collector module. It's now a directory, not a file. Within it there's:

  • task.rs contains DebugCollectorTask and FormerZoneRootArchiver
  • handle.rs contains DebugCollector
  • worker.rs contains DebugCollectorWorker and all the tests
  • helpers.rs contains the dependency injection traits, their "real" impls, and some supporting types

I also added a detailed comment to debug_collector/mod.rs that explains the structure.

I think this makes each module a lot simpler to understand. In future work I plan to factor out more of the worker implementation and it'll be important to be able to separate pieces into different files, still all within the debug_collector module.

Staged on top of #9484.

Base automatically changed from dap/dump-setup-comments to main December 9, 2025 16:56
@davepacheco davepacheco marked this pull request as ready for review December 9, 2025 16:58
@davepacheco davepacheco enabled auto-merge (squash) December 9, 2025 16:59
@davepacheco davepacheco merged commit 5d08d2f into main Dec 10, 2025
16 checks passed
@davepacheco davepacheco deleted the dap/dump-setup-modules branch December 10, 2025 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants