microsoft / RTVS

R Tools for Visual Studio.
MIT License
390 stars 110 forks source link

Creating an invalid composite Xdf file in MS R Server hangs REPL #3735

Open hongooi73 opened 7 years ago

hongooi73 commented 7 years ago

A composite Xdf file is actually a directory that contains multiple data and metadata files. If these files are tampered with, the REPL seizes up -- I guess it's a problem with the Variable Explorer.

mtc <- RxXdfData("mtcarsc", createCompositeSet=TRUE)
rxDataStep(mtcars, mtc, overwrite=TRUE)

# in Explorer or elsewhere, go to the mtcarsc dir and rename/delete files in the data subdir

ls()
# REPL hangs
MikhailArkhipov commented 7 years ago

Seems to work for me. Something is locking the folder perhaps?

image

hongooi73 commented 7 years ago

From the screenshot, it looks like you changed the file extension? Try changing the file name, and you should see the problem.

Eg this is what I get:

image

> mtc <- RxXdfData("misc/mtcarsc", createCompositeSet=TRUE)
+ rxDataStep(mtcars, mtc, overwrite=TRUE)
+ 
> mtc
RxXdfData Source
"misc/mtcarsc"
fileSystem: 
    fileSystemType: native
createCompositeSet: TRUE
> 
The path '.\misc\mtcarsc\data' is not a legal data path for a split XDF file. The name of the directory must
be the same as the base name of the file without its file number and extension (that is, 'xxx'),
and it must be in a subdirectory named 'data'.

After printing the error message, the REPL freezes.