posit-dev / posit-dev/ark

Remove usage of `r_task()`

Open
#691 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: jupyter kernel area: language server infra: reliability
Dominant language
Rust
Stars
337
Forks
32
Avg merge
8d 17h
Merged PRs (30d)
11

Description

Currently there are many places where we evaluate R code / access the R API through the use of r_task(), which hooks into R's polled events. This makes it easy to implement analytic features but has a number of downsides:

  • The R event polls might be slowed down of stuck if native code running in the R session doesn't check for interrupts sufficiently often.

  • While R polls at specific times such as checks for interrupts, in practice we should consider polled events to be preemptive. This is unsafe because we might accidentally call a non-rentrant function, for instance we might force a promise that causes a loadNamespace(), which is not reentrant, while it is already running. It is difficult to manage these risks as the project grows and many features are added, querying R all the time.

So we should strive to reduce concurrent evaluations to the bare minimum:

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

The issue does not name files or tests; start by locating the usages and implementation of r_task() in the ark repository, then review linked issues #689, #2321, and #1095 for scope. Done means the remaining concurrent R evaluations are reduced to the intended minimum and the referenced work items are addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, rust
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.