RestartSession doesn't run the command after restarting in R3.5.1

Open
#124 24 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
r
Domain
api

Research direction

Start with the restartSession function and reproduce the issue using a simple command such as print('Hello'), then compare it with source(path). Done means the supplied command runs and produces output after the R session restarts.

Written by the indexing model from the issue text.

Description

Hi,

I am using restartSession to deal with the problem of insufficient memory and need to clear the memory after each for loop iteration. I have written a code with the intention that a for loop will continue after restarting the R session.

I am grateful for the function restartSession as it allowed my code to run correctly for a week straight before memory became a problem again.

Part of how I do this is to get the restartSession function to source the same script again. This worked for a while but now it does not work anymore. I tried running a simple print('Hello') and '1+1' as the command to run after restarting but there was no output after r restarted.

The actual code which I ran previously is simple.
restartSession(command = "source(path)")

The path is correct because if I copy out the source(path) it runs in the console correctly.

I appreciate any help to troubleshooting the problem.

Dominant language
R
Stars
175
Forks
37
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rstudio/rstudioapi

All issues in rstudio/rstudioapi

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.