awslabs / awslabs/shuttle

Run native blocking code

Open
#154 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.1k
Forks
59
Avg merge
4d 2h
Merged PRs (30d)
15

Description

I'm trying out shuttle for https://github.com/anacrolix/possum. In some tests that are multithreaded, I need to call in to rusqlite code which then calls into C code which blocks the calling thread. After lots of trial and error I think I discovered that shuttle is not using native threads under the hood but its own kind of green threading. This doesn't play well with calling into code that hasn't been instrumented with shuttle primitives.

How can I call into that code? I was going to create a wrapper that spawned a native thread to run blocking code in rusqlite, then wait on the result from a shuttle mpsc channel but then I realised I can't send the result into a shuttle channel from a thread that wasn't created by shuttle.

Contributor guide

Open the contributing guide

Research direction

The issue names no repository files or tests. Start by tracing Shuttle's native-thread and mpsc-channel behavior alongside the rusqlite call path; done means there is a documented, supported way to call blocking native code and return its result from a Shuttle test.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sqlite
Domain
testing-qa, tooling
Issue type
Feature
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.