cpu icon indicating copy to clipboard operation
cpu copied to clipboard

cpud did not connect for more than 100ms

Open brho opened this issue 3 years ago • 1 comments

if you set cpu -namespace "" (empty string), instead of none or ":", cpu will complain.

notably debug lines (target machine is 7 hours ahead, which helps with debugging!):

2022/04/11 16:42:32 CPUD:namespace is ""
2022/04/11 09:42:32 cpud did not connect for more than 100ms

looks like cpu started the 9p server, but cpud never dialed back. there's a mismatch in what it means to have no CPU_NAMESPACE (empty vs non-existent). cpu will start the 9p server since namespace is not "none". cpud won't dial back since len(bindover) == 0.

possibly related: should CPU_NAMESPACE work for cpu?

if i try this:

CPU_NAMESPACE="" ./cpu

i get:

2022/04/11 16:53:48 CPUD:namespace is "/lib:/lib64:/usr:/bin:/etc:/home"

not sure if CPU_NAMESPACE is used in cpu anymore. its value gets discarded in one of the spots i see in cmds/cpu/cpu.go:

_, wantNameSpace := os.LookupEnv("CPU_NAMESPACE")

brho avatar Apr 11 '22 16:04 brho

Yea, CPU_NAMESPACE has been redesigned a bit:

  • If CPU_NAMESPACE is set to "none", you should run into https://github.com/u-root/cpu/blob/main/cmds/cpu/cpu.go#L215
  • If unset, it defaults to what you saw in your log, coming from https://github.com/u-root/cpu/blob/main/cmds/cpu/cpu.go#L52

Regarding the timeout: Try increasing it; i.e., ./cpu -timeout9P=500 etc.. Depending on the setup, the 100ms can be too low (I've had that with less powerful devices and especially over Wi-Fi and stuff; could be problematic with QEMU, too).

orangecms avatar Apr 11 '22 23:04 orangecms