[Rd] Background R session on Unix and SIGINT

Gábor Csárdi c@@rd|@g@bor @end|ng |rom gm@||@com
Tue Apr 30 21:44:35 CEST 2019


Hi All,

I realize that this is not a really nice reprex, but anyone has an
idea why a background R session would "remember" an interrupt (SIGINT)
on Unix?

rs <- callr::r_session$new()
rs$interrupt()     # just sends a SIGINT
#> [1] TRUE

rs$run(function() 1+1)
#> Error: interrupt

rs$run(function() 1+1)
#> [1] 2

It seems that the main loop somehow stores the SIGINT it receives
while it is waiting on stdin, and then it triggers it when some input
comes in.... Maybe. Just speculating....

Thanks,
Gabor



More information about the R-devel mailing list