Skip to content

TESTS: Improve error handling when a required package is missing on worker #25

Closed

Description

@HenrikBengtsson

Issue

If a worker don't have a package installed, then doFuture may produce an obscure error message such as:

Error: length(results) == nbr_of_elements is not TRUE

or in the develop version as:

Error: Unexpected error in doFuture(): After gathering and merging the results from 7 chunks in to a list, the total number of elements (= 14) does not match the number of input elements in 'X' (= 100). There were in total 7 chunks and 7 elements (7 chunks with 2 elements)

A real example based on workers running in bare-bone R Docker containers (e.g. futureverse/future#220 (comment)) will end up with these errors. Enabling options(doFuture.debug = TRUE) will reveal the actual problem:

Unexpected error in doFuture(): After gathering and merging the results from 7 chunks in to a list, the total number of elements (= 14) does not match the number of input elements in 'X' (= 100). There were in total 7 chunks and 7 elements (7 chunks with 2 elements)
chunk_sizes
2 
7 
Results before merge chunks:
List of 7
 $ :List of 2
  ..$ message: chr "there is no package called ‘doFuture’"
  ..$ call   : language loadNamespace(name)
  ..- attr(*, "class")= chr [1:3] "simpleError" "error" "condition"
 $ :List of 2
  ..$ message: chr "there is no package called ‘doFuture’"
  ..$ call   : language loadNamespace(name)
  ..- attr(*, "class")= chr [1:3] "simpleError" "error" "condition"
[...]
Results after merge chunks:
List of 14
 $ message: chr "there is no package called ‘doFuture’"
 $ call   : language loadNamespace(name)
 $ message: chr "there is no package called ‘doFuture’"
 $ call   : language loadNamespace(name)
[...]
Error: Unexpected error in doFuture(): After gathering and merging the results from 7 chunks in to a list, the total number of elements (= 14) does not match the number of input elements in 'X' (= 100). There were in total 7 chunks and 7 elements (7 chunks with 2 elements)

Actions

Related

The future.apply package probably gives equally obscure error message right now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions