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

Building mongod on a single core Ubuntu has been hanging. #10

Open
mzdk100 opened this issue Aug 20, 2024 · 5 comments
Open

Building mongod on a single core Ubuntu has been hanging. #10

mzdk100 opened this issue Aug 20, 2024 · 5 comments

Comments

@mzdk100
Copy link

mzdk100 commented Aug 20, 2024

The cargo process keeps waiting and will not end unless it is terminated using Ctrl+C.

...
Compiling mongodb v2.8.2
@alexkornitzer
Copy link
Contributor

I am not able to replicate are you able to provide a minimal example that can reproduce the hang? I tried it in Ubuntu Jammy with the example on the README.md using rust 1.80.1 and it compiles without hanging.

@mzdk100
Copy link
Author

mzdk100 commented Aug 22, 2024

Hi, I am also running an example in the README:

use futures::stream::StreamExt;
use mongod::{Bson, Mongo};
use mongod::{AsFilter, AsUpdate, Collection, Comparator, Updates};

#[derive(Debug, Bson, Mongo)]
#[mongo(collection = "users", field, filter, update)]
pub struct User {
  pub name: String,
  pub age: Option<u32>,
}

#[tokio::main]
async fn main() {
  // Create and async client
  let client = mongod::Client::new();

  // Insert a user into the users collection
  let user = User { name: "foo".to_string(), age: None };
  let oid = client.insert_one::<User>(user).await.unwrap();
  println!("{:?}", oid);

  // Fetch all users in the users collection
  let mut cursor = client.find::<User, _>(None).await.unwrap();
  while let Some(res) = cursor.next().await {
      if let Ok((id, user)) = res {
          println!("{} - {:?}", id, user);
      }
  }

  // Update the user
  let mut filter = User::filter();
  filter.name = Some(Comparator::Eq("foo".to_owned()));
  let mut update = User::update();
  update.age = Some(Some(0));
  let updates = Updates {
      set: Some(update),
      ..Default::default()
  };
  let updated = client.update::<User, _, _>(filter, updates).await.unwrap();
  println!("updated {} documents", updated);

  // Delete all users
  let deleted = client.delete::<User, _>(None).await.unwrap();
  println!("delete {} documents", deleted);
}

There will be a suspension situation, and I will send the SSH login information of my server to your email later.
The path to the example directory is:/home/ubuntu/hello, thank you.

@dariusc93
Copy link

Hey! You might want to give more information about your environment, the amount of disk space, ram, etc. If you're building in a vps then it could also be something with that environment and not with the project itself.

@alexkornitzer
Copy link
Contributor

Hey @mzdk100, thanks for the trust in proposing to let me SSH into your server but really if at all, that should be a last resort. I would prefer to replicate locally than to SSH into an unknown box. I think as @dariusc93 has suggested providing the RAM, cargo/rust versions, OS version and disk space would be a better first step.

@mzdk100
Copy link
Author

mzdk100 commented Aug 24, 2024

It's okay, you can help connect and troubleshoot it, which will also make it easier to reproduce the problem. The main issue is that this problem may be rare, and even if I tell you this information, it will be difficult for you to find a machine with the same configuration.

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

No branches or pull requests

3 participants