matrix-org / matrix-org/matrix-rust-sdk

Use the new task monitor for long-lived background jobs

Open
#6,098 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.3k
Forks
500
Avg merge
1d 16h
Merged PRs (30d)
106

Description

https://github.com/matrix-org/matrix-rust-sdk/pull/6075 adds a mechanism to watch background jobs spawned with `tokio::spawn` that have failed (either with a panic, or with a `Result::Err`). The same PR introduced its usage in the event cache, but we should expand it to more places in the SDK, i.e. for every background task.

This is rather mechanical, and requires a bit of thought for each case. In particular, if a job is spawned in the background but awaited immediately, it should *not* use this mechanism; this is really for jobs that ought to live ~forever until the program dies (or aborted in rare cases).

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

Read PR 6075 and its event cache usage to understand the new task monitor. Search the SDK for background jobs spawned with tokio::spawn, then inspect each case to distinguish long-lived tasks from jobs awaited immediately. Done means long-lived background tasks use the monitor while immediately awaited jobs remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.