HenrikBengtsson / future

:rocket: R package: future: Unified Parallel and Distributed Processing in R for Everyone
https://future.futureverse.org
946 stars 82 forks source link

Warning in serialize #528

Open dcaud opened 2 years ago

dcaud commented 2 years ago

As mentioned in an earlier closed issue (https://github.com/HenrikBengtsson/future/issues/48), I'm getting this warning:

Warning in serialize(data, node$con, xdr = FALSE) : 'package:promises' may not be available when loading

Not fully reproducible (sorry!), but here's the gist of code that produces the warning:

 plan(multisession, gc=TRUE)
 result_val <- reactiveVal()

          result <- future(seed=NULL,{
            temp1 <- image_read_pdf(
              pdfFileLocation.here,
              density = floor(
                density.for.download * density.multiplier.for.big.files.here
              ),
              pages = pages.to.process.max.here
            ) %>%
              replace.color(
                color.selected.here) %>% image_write(
              tempfile(pattern = "pdftemp", fileext = '.pdf'),
              density = floor(
                density.for.download * density.multiplier.for.big.files.here
              ),
              format = 'pdf'
            )
            progress$close()
            cat("Done with pdf recolor future")
            file.copy(temp1, file)
          },
          gc=TRUE) %...>% 
            result_val()

          result <- catch(result,
                          function(e){
                            result_val(NULL)
                            progress$close()
                            cat("\nfuture result error: ",e$message)
                            showNotification(e$message)
                          })

          result <- finally(result,
                            function(){
                              future:::ClusterRegistry("stop")
                            })

          result
HenrikBengtsson commented 2 years ago

Hi, thanks for this. What's your sessionInfo()?

Also, is there any chance you could make this reproducible, because without a reproducible example it'll be hard for me to troubleshooting. Maybe you can find an online PDF together with real values for those place-holder variables that can be used to reproduce it?