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

Unable to compile with tokio runtime

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 1.1.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • 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)

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: