Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-558

Unable to compile with tokio runtime

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.1.1
    • Component/s: None
    • Labels:
    • Environment:
      - macos 10.15.6
      - parallels desktop 15 vm
      - debian 10.5
      - rustc 1.46.0 (04488afe3 2020-08-24)
      - cargo 1.46.0 (149022b1d 2020-07-17)

      Application is built on top of actix-web 3.0.1 accessing mongodb via 1.1.1 driver.

      when building the application with cargo, building process stuck on one line of code.
       

      #[post("/search_username")]
      pub(crate) async fn query_user(
          mongo_conn: Data<Client>, 
          form: web::Form<Username>
      ) -> HttpResponse { 
          let username = &form.username;
          let collection = mongo_conn.database("ngiam-db").collection("userEntity");
          let filter = doc! {"username":username};
          let fo = FindOptions::builder()    
              .projection(doc! {"username":1, "displayName":1, "groupChain":1,      
              "_id":0}) .build(); 
          let cursor = collection.find(filter, fo).await;    <--- this line
          
          unimplemented!()
      }

       strace cargo build shows

      stuck rustc process eventually exhaust all memory.

       

      This issue can be avoided by switching to async-std runtime.

       

      Complete dependencies as follow

            Assignee:
            Unassigned Unassigned
            Reporter:
            maicallist@gmail.com gao chen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: