Closed HenrikBengtsson closed 5 months ago
Hmm... still don't understand. After adding more debug info, the value that it tries to assign to pid
is indeed an integer;
DEBUG: Checking that the 'rserver' process is still running ...
DEBUG: rs_process_status(pid=1207525, hostname=dev3):
DEBUG: - check_pid('1207525', '') exit code: 0, output='DEBUG: check_pid(pid=1207525, hostname=dev3) ... DEBUG: - Checking /proc/12
07525 on current machine (dev3) DEBUG: - dev3:/proc/1207525 exists 1207525 DEBUG: check_pid(pid=1207525, hostname=dev3) ... done '
DEBUG: - prune_debug(): 1207525
DEBUG: - pid='1207525'
bin/rsc: line 694: 1207525: syntax error: operand expected (error token is "1207525")
DEBUG: _RSC_RSERVER_PORT_='3987'
DEBUG: Checking that the 'rserver' process is still running ... done
DEBUG: Waiting for background process (PIDs 1207629) to finish ...
Ah, when writing ${res[0]}
to file, it reveals that there are stray, invisible symbols;
pid='\u{f}1210729'
which I take as Unicode symbol U+000F
, i.e. ASCII 0x0F = ASCII 10 = LF = \n
.
This is because the internal prune_debug()
fails to prune everything, e.g.
$ printf "%q\n" "$(prune_debug $'\E[m\017326730')"
$'\017326730'
That error occurs in:
https://github.com/UCSF-CBI/rstudio-server-controller/blob/739e337b1e3f40e4817cd5a36dd360315fbfcd80/bin/rsc#L687-L692
where
pid
is defined as an integer, i.e.local -i pid
.