Closed datawookie closed 1 year ago
Thank you; here's a minimal reproducible example:
library(emayili)
library(doFuture)
plan(cluster, workers = 1)
y <- foreach(x = NULL) %dofuture% NULL
I'll investigate.
Thank you @HenrikBengtsson!
This has been fixed in future (>= 1.33.0-9003).
The problem was that a getExpression()
method of the future package ended up calling emayili::local()
instead of base::local()
as intended whenever emayili was attached on the parallel worker. In turn, emayili::local()
called as.address()
, giving the error. It only happened for cluster/multisession futures.
Here's another example, without emayili, illustrating the problem:
> local <- function(...) stop("Wrong local()!")
> library(doFuture)
> plan(cluster, workers = 1)
> y <- foreach(x = NULL) %dofuture% NULL
Error in local({ : Wrong local()!
Wow! Thanks @HenrikBengtsson for tracking down and fixing this so promptly. Really appreciate it. Best regards, Andrew.
Describe the bug
Firstly I should point out that this is NOT a bug with
{doFuture}
. However, it is a bug reported on my{emayili}
package that only manifests itself with{doFuture}
. I have tried to debug this and got nowhere. I suspect that this is because I really don't understand how{doFuture}
works. I was hoping that you would please help or give me some suggestions of where I might look.The original bug is described here.
Reproduce example
The code below produces the error.
Importantly note that no functions from
{emayili}
are being explicitly called. Simply importing the package is enough to break the script.I have tried changing the order of importing
{emayili}
(first and last) and this does not seem to have any effect.This is the error message:
Here is the backtrace:
I tracked the function call mentioned in the error message to a generic function in
{emayili}
:I seriously do not expect you to solve the problem. But if you could suggest where I should start looking or how I could debug this I would be most grateful!
Expected behavior
Simply including the package should not make any difference to the execution of the script.
Session information Please share your session information, e.g.