radian icon indicating copy to clipboard operation
radian copied to clipboard

radian freezing when Java issued message is redirected to stderr

Open dhersz opened this issue 3 years ago • 0 comments

Hi. I'm a co-author of an R package that makes heavy use of a Java application. This application prints many informative messages, and we decided to redirect them to stderr . The problem is that when we do it my radian console just freezes on some messages. The console wasn't freezing when messages were sent to stdout, and it doesn't freeze either when I run the same code on Rstudio.

I run radian with neovim + Nvim-R + tmux. I tried running it outside tmux but I stumbled across he same problem.

I tried replicating the issue with cat(<some message>, file = stderr()), but I didn't manage to reproduce the problem. I tried a few different messages, long ones, short ones, some that include \n and \r, but nothing did it.

To be really honest I'm not sure if this is a problem with the message redirection in Java or with radian, but since it worked on Rstudio I figured out it could be the latter (but not sure, honestly).

I know it's not a great way to create a reproducible example, but if you're willing to clone our repo (https://github.com/ipeaGIT/r5r) and test in your setup, the following code results in a console freeze on my side:

# after cloning the repo and loading the package with devtools::load_all()
data_path <- system.file("extdata/poa", package = "r5r")
r5r_core <- setup_r5(data_path, verbose = FALSE) # will download a R5 jar to the package directory
pois <- data.table::fread(file.path(data_path, "poa_points_of_interest.csv"))

travel_time_matrix(r5r_core, pois[1:5], pois[1:5], progress = TRUE)

Sorry for the not so reproducible code, especially one that downloads a file into your computer, but I couldn't come up with an easier way to reproduce it.

Best regards

dhersz avatar Jun 06 '22 19:06 dhersz