You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Andrew Lamb (Jira)" <ji...@apache.org> on 2020/11/24 12:36:00 UTC

[jira] [Commented] (ARROW-10710) [Rust] [Flight] Example server is broken after tokio upgrade

    [ https://issues.apache.org/jira/browse/ARROW-10710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17238087#comment-17238087 ] 

Andrew Lamb commented on ARROW-10710:
-------------------------------------

Building tokio with the right features in the example gets it farther, but then it fails at runtime with {{thread 'main' panicked at 'there is no reactor running, must be called from the context of Tokio runtime}}

{code}

alamb@MacBook-Pro arrow-flight % git diff
git diff
WARNING: terminal is not fully functional
-  (press RETURN)
diff --git a/rust/arrow-flight/Cargo.toml b/rust/arrow-flight/Cargo.toml
index e1a93c4fe..f8f0b13ed 100644
--- a/rust/arrow-flight/Cargo.toml
+++ b/rust/arrow-flight/Cargo.toml
@@ -31,7 +31,7 @@ tonic = "0.3"
 bytes = "0.5"
 prost = "0.6"
 prost-derive = "0.6"
-tokio = {version = "0.3", features = ["macros"]}
+tokio = { version = "0.3", features = ["macros", "rt", "rt-multi-thread"] }
 futures = { version = "0.3", default-features = false, features = ["alloc"]}

 [build-dependencies]
alamb@MacBook-Pro arrow-flight % 

alamb@MacBook-Pro arrow-flight % cargo run --example server
cargo run --example server
   Compiling num_cpus v1.13.0
   Compiling tokio v0.3.4
   Compiling arrow-flight v3.0.0-SNAPSHOT (/Users/alamb/Software/arrow2/rust/arrow-flight)
    Finished dev [unoptimized + debuginfo] target(s) in 7.01s
     Running `/Users/alamb/Software/arrow2/rust/target/debug/examples/server`
thread 'main' panicked at 'there is no reactor running, must be called from the context of Tokio runtime\
', /Users/alamb/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.23/src/io/driver/mod.rs:204:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
{code}

> [Rust] [Flight] Example server is broken after tokio upgrade
> ------------------------------------------------------------
>
>                 Key: ARROW-10710
>                 URL: https://issues.apache.org/jira/browse/ARROW-10710
>             Project: Apache Arrow
>          Issue Type: Bug
>            Reporter: Andrew Lamb
>            Priority: Major
>
> As pointed out by [~rdettai] on https://github.com/apache/arrow/pull/8697#issuecomment-732936572
> Doing this:
> {code}
> cd rust/arrow-flight; cargo run --example server
> {code}
> results in the following compile error
> {code}
> error: The #[tokio::main] macro requires rt or rt-multi-thread.
>    --> arrow-flight/examples/server.rs:121:1
>     |
> 121 | #[tokio::main]
>     | ^^^^^^^^^^^^^^
>     |
>     = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
> warning: unused import: `tonic::transport::Server`
>   --> arrow-flight/examples/server.rs:21:5
>    |
> 21 | use tonic::transport::Server;
>    |     ^^^^^^^^^^^^^^^^^^^^^^^^
>    |
>    = note: `#[warn(unused_imports)]` on by default
> warning: unused import: `flight_service_server::FlightServiceServer`
>   --> arrow-flight/examples/server.rs:25:43
>    |
> 25 |     flight_service_server::FlightService, flight_service_server::FlightServiceServer,
>    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> error[E0601]: `main` function not found in crate `server`
>    --> arrow-flight/examples/server.rs:18:1
>     |
> 18  | / use std::pin::Pin;
> 19  | |
> 20  | | use futures::Stream;
> 21  | | use tonic::transport::Server;
> ...   |
> 130 | |     Ok(())
> 131 | | }
>     | |_^ consider adding a `main` function to `arrow-flight/examples/server.rs`
> error: aborting due to 2 previous errors; 2 warnings emitted
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)