From 1964022bd4ae3c35688b98f6a4db45076c7d002c Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 9 May 2023 16:16:52 +0200 Subject: syz-ci: assign RPC ports to instances As we currently assign HTTP ports for managers, but do not assign RPC ports, it introduces a risk of port collision (e.g. if some randomly chosen RPC port overlaps with one of the not-yet-listened-to HTTP ports). Avoid this by assigning RPC ports as well. --- syz-ci/syz-ci.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'syz-ci') diff --git a/syz-ci/syz-ci.go b/syz-ci/syz-ci.go index 68a804f84..45671723b 100644 --- a/syz-ci/syz-ci.go +++ b/syz-ci/syz-ci.go @@ -83,7 +83,9 @@ type Config struct { Name string `json:"name"` HTTP string `json:"http"` // If manager http address is not specified, give it an address starting from this port. Optional. - ManagerPort int `json:"manager_port_start"` + ManagerPort int `json:"manager_port_start"` + // If manager rpc address is not specified, give it addresses starting from this port. By default 30000. + RPCPort int `json:"rpc_port_start"` DashboardAddr string `json:"dashboard_addr"` // Optional. DashboardClient string `json:"dashboard_client"` // Optional. DashboardKey string `json:"dashboard_key"` // Optional. @@ -339,6 +341,7 @@ func loadConfig(filename string) (*Config, error) { SyzkallerRepo: "https://github.com/google/syzkaller.git", SyzkallerBranch: "master", ManagerPort: 10000, + RPCPort: 30000, Goroot: os.Getenv("GOROOT"), JobPollPeriod: 10, CommitPollPeriod: 3600, @@ -419,6 +422,10 @@ func loadManagerConfig(cfg *Config, mgr *ManagerConfig) error { managercfg.HTTP = fmt.Sprintf(":%v", cfg.ManagerPort) cfg.ManagerPort++ } + if managercfg.RPC == "" { + managercfg.RPC = fmt.Sprintf(":%v", cfg.RPCPort) + cfg.RPCPort++ + } // Note: we don't change Compiler/Ccache because it may be just "gcc" referring // to the system binary, or pkg/build/netbsd.go uses "g++" and "clang++" as special marks. mgr.Userspace = osutil.Abs(mgr.Userspace) -- cgit mrf-deployment