memoise icon indicating copy to clipboard operation
memoise copied to clipboard

Usage inside deployed app

Open john-c-martens opened this issue 5 years ago • 1 comments

This issue is similar to Issue #29. I'm using the memoise function inside an R Shiny app and deploying the app using RSConnect. (This work was done in my capacity as a Bayer employee, for the record.) On the deployed app, race conditions obtain when multiple R processes chase the same cached file. The race can result in a corrupted cache file, which will persist afterwards. The solution is to lock the files in the memoise package using a try ... finally pattern. I'm planning to fork off my own fixed version of memoise and submit those fixes back to the main branch.

john-c-martens avatar Sep 11 '20 19:09 john-c-martens

If the issue is a race between $has_key() and $get(): that's something that we're planning on addressing, with some general changes to the caching system. Regarding the possibility of multiple processes writing to the same file (as in #29), that's also something we will address -- the solution is to write to a temp file, then rename it.

wch avatar Sep 14 '20 16:09 wch