Skip to content
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

Remove tokio runtime dependency in binder #13293

Open
TennyZhuang opened this issue Nov 7, 2023 · 1 comment
Open

Remove tokio runtime dependency in binder #13293

TennyZhuang opened this issue Nov 7, 2023 · 1 comment
Assignees

Comments

@TennyZhuang
Copy link
Contributor

TennyZhuang commented Nov 7, 2023

Currently, we utilize the FrontendEnv extensively in the risingwave-frontend crate, which complicates and makes testing the binder a tedious task. Creating a FrontendEnv relies on the tokio runtime, requiring all binder tests to initialize a tokio runtime. For example:

    #[tokio::test]
    async fn basic_value() {
        expect_actual_eq(
            create_expect_bound("values(1::int4)"),
            create_actual_bound(
                "values($1::int4)",
                vec![],
                vec![Some("1".into())],
                vec![Format::Text],
            ),
        );
    }

    #[tokio::test]
    async fn default_type() {
        expect_actual_eq(
            create_expect_bound("select '1'"),
            create_actual_bound(
                "select $1",
                vec![],
                vec![Some("1".into())],
                vec![Format::Text],
            ),
        );
    }

Removing tokio::test seems strange, but if we do so, the test will panic.

To create FrontendEnv, we need to initialize a hummock_snapshot_manager and spawn an unpinned background worker.

tokio::spawn(UnpinWorker::new(meta_client, worker_receiver).run());

The field is definitely useless in the whole binder module, I'd prefer split a BinderEnv from FrontendEnv.

@github-actions github-actions bot added this to the release-1.5 milestone Nov 7, 2023
Copy link
Contributor

github-actions bot commented Feb 4, 2024

This issue has been open for 60 days with no activity. Could you please update the status? Feel free to continue discussion or close as not planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants