Skip to content

Trouble changing plans #430

@wlandau

Description

@wlandau

This issue is related to #263 (comment) and https://github.com/wlandau/targets/issues/198#issuecomment-712433554, and it interferes with the ability of targets to create heterogeneous transient workers (cc @mattwarkentin).

When I stick to a multisession plan before running any futures, things seem to work fine.

library(future)
plan_sequential <- plan(multisession, workers = 4)
plan_multisession <- plan()
out <- future(1)
resolved(out)
#> [1] TRUE

Created on 2020-10-19 by the reprex package (v0.3.0)

However, when I try to change to a sequential plan before calling resolved(), the connection gets corrupted.

library(future)
plan_sequential <- plan(multisession, workers = 4)
plan_multisession <- plan()
out <- future(1)
plan(plan_sequential)
resolved(out)
#> Error: Cannot resolve MultisessionFuture (<none>), because the connection to the worker is corrupt: Connection (connection: index=4, description="NA", class="NA", mode="NA", text="NA", opened="NA", can read="NA", can write="NA", id=210, raw_id="<pointer: 0xd2>") is no longer valid. There is currently no registered R connection with that index 4

Created on 2020-10-19 by the reprex package (v0.3.0)

Same thing if I try to restore the original multisession plan.

library(future)
plan_sequential <- plan(multisession, workers = 4)
plan_multisession <- plan()
out <- future(1)
plan(plan_sequential)
plan(plan_multisession)
resolved(out)
#> Error: Cannot resolve MultisessionFuture (<none>), because the connection to the worker is corrupt: Connection (connection: index=4, description="NA", class="NA", mode="NA", text="NA", opened="NA", can read="NA", can write="NA", id=210, raw_id="<pointer: 0xd2>") is no longer valid. There is currently no registered R connection with that index 4

Created on 2020-10-19 by the reprex package (v0.3.0)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions