diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-11-07 16:01:00 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-11-07 16:50:40 +0000 |
| commit | 6410b21bc162fd5f9527bda7484828c53cd872d0 (patch) | |
| tree | b628ceee8e459fa8e62ab492ba38e577b5d777ac /syz-manager/manager.go | |
| parent | 069a4a6eb9923b8553bcbc4dd2d75a528da14453 (diff) | |
pkg/manager: set more http fields before calling Serve
Pools and ReproLoop and always created on start,
so there is no need to support lazy set for them.
It only complicates code and makes it harder to reason about.
Also introduce vm.Dispatcher as an alias to dispatcher.Pool,
as it's the only specialization we use in the project.
Diffstat (limited to 'syz-manager/manager.go')
| -rw-r--r-- | syz-manager/manager.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/syz-manager/manager.go b/syz-manager/manager.go index 922639407..9318bf8b2 100644 --- a/syz-manager/manager.go +++ b/syz-manager/manager.go @@ -73,7 +73,7 @@ type Manager struct { cfg *mgrconfig.Config mode Mode vmPool *vm.Pool - pool *dispatcher.Pool[*vm.Instance] + pool *vm.Dispatcher target *prog.Target sysTarget *targets.Target reporter *report.Reporter @@ -242,8 +242,6 @@ func RunManager(mode Mode, cfg *mgrconfig.Config) { } else { close(mgr.corpusPreload) } - go mgr.http.Serve() - go mgr.trackUsedFiles() // Create RPC server for fuzzers. mgr.servStats = rpcserver.NewStats() @@ -294,11 +292,13 @@ func RunManager(mode Mode, cfg *mgrconfig.Config) { return } mgr.pool = vm.NewDispatcher(mgr.vmPool, mgr.fuzzerInstance) - mgr.http.Pools.Store(manager.DefaultPool, mgr.pool) + mgr.http.Pool = mgr.pool mgr.reproLoop = manager.NewReproLoop(mgr, mgr.vmPool.Count()-mgr.cfg.FuzzingVMs, mgr.cfg.DashboardOnlyRepro) - mgr.http.ReproLoop.Store(mgr.reproLoop) + mgr.http.ReproLoop = mgr.reproLoop ctx := vm.ShutdownCtx() + go mgr.http.Serve() + go mgr.trackUsedFiles() go mgr.processFuzzingResults(ctx) mgr.pool.Loop(ctx) } |
