I have an R script that writes a large amount of data querying off of a database. The script queries dataframes (1M - 10M rows) and then processes the data and then writes CSV with the output.
It keeps crashing with this message:
The previous R session was abnormally treminated due to an unexpected crash.
I'd like to make it more robust to crashing, or find out why it's crashing. I put all the data querying, munging and writing into a single function, Since it keeps crashing, I've been restarting it by hand each time.
Are there ways I can automatically retry the script after it scripts? Or, are there bigger design challenges that I should be taking on?
Edit--
I updated the original script from using tibbles to data tables. It's much faster and crashes less frequently, but it continues to crash. I'd like to set up logic like this:
- Start running a particular function in the script and keep running it
- If it crashes, try again beginning with the most recent successful "start date" (an argument in the function)
- Check if it has crashed every 5-10 minutes
Can I accomplish this with Plumbr?