Skip to content

dopar .errorhandling options are not working #164

@statquant

Description

@statquant

Using clustermq as a foreach backend does not work as expected.
Typically the very important .errorhandling option does not seem to work, when .errorhandling = "pass" any error happening on the slave process should come back as an error object and all other results should be returned to the user.
It seems it is not working as per bellow

library(clustermq)                                                                      
foo <- function(i)                                                                      
{                                                                                       
    if (i == 1)                                                                         
        return(10)                                                                      
    else if (i == 2)                                                                    
        return(20)                                                                      
    else                                                                                
        stop("nope...")                                                                 
}                                                                                       
register_dopar_cmq(n_jobs = 5, memory = 40*1024, template = list(partition = partition))
                                                                                        
res <- foreach(x_i = 1:3, .errorhandling = "pass") %dopar% foo(x_i)                     
#Master: [0.7s 18.4% CPU]; Worker: [avg 87.3% CPU, max 232.8 Mb]                        
#Error in summarize_result(job_result, n_errors, n_warnings, cond_msgs,  :              
#                           1/3 jobs failed (0 warnings). Stopping.                     
#                           (Error #3) nope...     

Many thanks for this great package, it helps tremendously

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions