REditorSupport / REditorSupport/vscode-R

Crew package does not work with vscode-R

Open
#1,452 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

Description

Describe the bug
When using package crew in vscode-R, local workers do not start. I have not tried remote workers. crew is now the preferred method for high-performance computing for the targets package so this will affect quite a lot of people.

To Reproduce
I can reliably reproduce this using a slightly modified example from crew's introduction vignette:

library(crew)
controller <- crew_controller_local(
  name = "example",
  workers = 2,
  seconds_idle = 10
)
controller$start()
controller$push(name = "get pid", command = ps::ps_pid())
Sys.sleep(1)
controller$pop()

The last statement should return information on the spawned workers, instead it returns NULL.

Running another example from the vignette leads to nonsensical output because no workers are started:

results <- controller$map(
  command = a + b + c + d,
  iterate = list(
    a = c(1, 3),
    b = c(2, 4)
  ),
  data = list(c = 5),
  globals = list(d = 6)
)

# -1 of 2 tasks done (-50%)

This happens every time when using vscode-R, both with a radian console and a vanilla terminal, but not in radian or a vanilla terminal outside of vscode-R, and not in RStudio.

Can you fix this issue by yourself? (We appreciate the help)

No

(If applicable) Please attach setting.json

{
    "security.workspace.trust.untrustedFiles": "open",
    "editor.largeFileOptimizations": false,
    "editor.unicodeHighlight.ambiguousCharacters": false,
    "editor.unicodeHighlight.nonBasicASCII": false,
    "r.plot.useHttpgd": true,
    "editor.fontLigatures": true,
    "editor.fontFamily": "'CaskaydiaCove Nerd Font', Menlo, Monaco, 'Courier New', monospace",
    "files.autoSave": "afterDelay",
    "r.rterm.option": [
        "--restore",
        "--save"
    ],
    "typescript.suggest.paths": false,
    "javascript.suggest.paths": false,
    "workbench.startupEditor": "newUntitledFile",
    "r.rterm.mac": "/usr/local/bin/R",
    "editor.fontSize": 13,
    "terminal.integrated.fontSize": 13,
    "editor.minimap.enabled": false,
    "terminal.integrated.defaultLocation": "editor",
    "window.confirmBeforeClose": "keyboardOnly",
    "terminal.integrated.confirmOnExit": "hasChildProcesses",
    "editor.formatOnType": true,
    "editor.tabSize": 2,
    "editor.inlineSuggest.enabled": true,
    "codeium.enableConfig": {
        "*": false,
        "rmd": true,
        "plaintext": true
    },
    "diffEditor.ignoreTrimWhitespace": false,
    "gitblame.statusBarMessageFormat": "${author.name} (${commit.summary, 30}, ${time.ago})",
    "codeium.enableSearch": true,
    "editor.acceptSuggestionOnEnter": "off",
    "editor.accessibilitySupport": "off"
}

Environment (please complete the following information):

  • OS: macOS 13.6.2
  • VSCode Version: 1.84.2
  • R Version: 4.3.2
  • vscode-R version: 2.8.2
  • crew version: 0.6.0
  • mirai version: 0.11.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the crew_controller_local example in vscode-R using the reported macOS, VS Code, R, vscode-R, crew, and mirai versions. Compare it with the same example outside VS Code; done means local workers start and controller$pop() returns worker information instead of NULL.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.