Skip to content

simulator: concurrent connection support #2113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

pereman2
Copy link
Collaborator

This commit adds support to run connections concurrently with option --max_connections, we achieve this with simple futures which we poll until they succeed to advance to next interaction for each connection/plan.

@pereman2 pereman2 requested a review from penberg as a code owner July 16, 2025 10:29
@pereman2 pereman2 force-pushed the simulator-concurrent branch from 125117d to 80b30e9 Compare July 17, 2025 11:52
Copy link
Contributor

blacksmith-sh bot commented Jul 17, 2025

2 Jobs Failed:

Rust / cargo-fmt-check
Step "Check formatting" from job "cargo-fmt-check" is failing. The last 20 log lines are:

[...]
  > Run cargo fmt --check
  cargo fmt --check
  shell: /usr/bin/bash -e {0}
  env:
    CARGO_TERM_COLOR: always
    GITHUB_REPO_NAME: tursodatabase/turso
    CARGO_HOME: /home/runner/.cargo
    CARGO_INCREMENTAL: 0
Diff in /home/runner/_work/turso/turso/simulator/runner/execution.rs:217:
         }
         Interaction::FsyncQuery(query) => {
             // SAFETY: we lock connection only inside execute plan which is async
-            let results = interaction.execute_fsync_query(connection.clone(), &mut env.lock().unwrap());
+            let results =
+                interaction.execute_fsync_query(connection.clone(), &mut env.lock().unwrap());
             tracing::debug!(?results);
             state.lock().unwrap().stack.push(results);
 
Error: Process completed with exit code 1.
Rust / clippy
Step "Clippy" from job "clippy" is failing. The last 20 log lines are:

[...]
200 ~                 ),
    |

error: variables can be used directly in the `format!` string
   --> simulator/runner/doublecheck.rs:197:17
    |
197 | /                 format!(
198 | |                     "connection and doublecheck are not both connected or disconnected {} vs {}",
199 | |                     connection, doublecheck_connection
200 | |                 )
    | |_________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    = note: `-D clippy::uninlined-format-args` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::uninlined_format_args)]`

error: could not compile `limbo_sim` (bin "limbo_sim" test) due to 7 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `limbo_sim` (bin "limbo_sim") due to 7 previous errors
Error: Process completed with exit code 101.

Summary: 7 successful workflows, 1 failed workflow

Last updated: 2025-07-21 08:54:02 UTC

pereman2 added 5 commits July 21, 2025 09:34
This commit adds support to run connections concurrently with option
`--max_connections`, we achieve this with simple futures which we poll
until they succeed to advance to next interaction for each
connection/plan.

refactor usage of plans, env and states

clippy

more clippy

remove prints

bring back rows.run_once

add yield_once primitive and run connections concurrently
@pereman2 pereman2 force-pushed the simulator-concurrent branch from 3edbab4 to e162149 Compare July 21, 2025 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant