Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors in dynamic() can give "restarting interrupted promise evaluation" warnings #1260

Closed
kevinushey opened this issue May 12, 2023 · 2 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@kevinushey
Copy link
Collaborator

We should see if we can avoid these. Examples:

options(
  renv.config.connect.timeout = 5L,
  renv.config.connect.retry = 0L
)

renv:::available_packages(type = "source", repos = "https://crab.rstudio.com")

Which gives:

> renv:::available_packages(type = "source", repos = "https://crab.rstudio.com")
* Querying repositories for available source packages ... Done!
Warning in value[[3L]](cond) :
  restarting interrupted promise evaluation
* Querying repositories for available source packages ... Done!
Warning: error downloading 'https://crab.rstudio.com/src/contrib/PACKAGES.rds' [curl: (6) Could not resolve host: crab.rstudio.com]
Warning: error downloading 'https://crab.rstudio.com/src/contrib/PACKAGES.gz' [curl: (6) Could not resolve host: crab.rstudio.com]
Warning: error downloading 'https://crab.rstudio.com/src/contrib/PACKAGES' [curl: (6) Could not resolve host: crab.rstudio.com]
Error: could not retrieve available packages for url 'https://crab.rstudio.com/src/contrib'
@kevinushey kevinushey added the bug an unexpected problem or unintended behavior label May 12, 2023
@kevinushey
Copy link
Collaborator Author

kevinushey commented May 12, 2023

The simplest fix would probably be to give a callback function to dynamic() rather than a value.

EDIT: No, this isn't sufficient. 😞

@kevinushey
Copy link
Collaborator Author

Should be resolved now -- the key bit is ensuring we don't try to force the promise twice; that can happen if (for example) the promise is forced while a tryCatch() error handler is active that discards the error, e.g.

> foo <- function(x) { try(x); x }
> foo(stop())
Error in try(x) : 
Error in foo(stop()) : 
  (converted from warning) restarting interrupted promise evaluation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant