diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-05-09 16:16:52 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2023-05-09 16:34:31 +0200 |
| commit | 1964022bd4ae3c35688b98f6a4db45076c7d002c (patch) | |
| tree | 4e360ec95621ecca0a871462fe3a96606ab6d53b /syz-ci | |
| parent | 4f98af4e2739ab80171a1f40119c329475889980 (diff) | |
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.
Diffstat (limited to 'syz-ci')
| -rw-r--r-- | syz-ci/syz-ci.go | 9 |
1 files changed, 8 insertions, 1 deletions
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) |
