From 6410b21bc162fd5f9527bda7484828c53cd872d0 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 7 Nov 2024 16:01:00 +0100 Subject: 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. --- syz-manager/manager.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'syz-manager') 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) } -- cgit mrf-deployment