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

Server crashed after spamming it with many clients #418

Closed
Seadragon91 opened this issue May 5, 2021 · 5 comments
Closed

Server crashed after spamming it with many clients #418

Seadragon91 opened this issue May 5, 2021 · 5 comments

Comments

@Seadragon91
Copy link

Seadragon91 commented May 5, 2021

Description

Spammed the server with many clients using pycraft. The clients joined the server, disconnected and connected again in a loop.

Reproduction Steps

  1. Spam the server with many clients and disconnect and reconnect them very quickly.

What You Expected to Happen

Server should be able to handle it, when many clients connects and disconnects.

What Actually Happened

Server crashes after spamming it with many clients.

Screenshots and Logs

thread main' panicked at 'called `Option::unwrap()` on a `None` value', feather/server/src/systems/view.rs:43:52

let client = server.clients.get(client_id).unwrap();

   0: rust_begin_unwind
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/panicking.rs:50:5
   3: core::option::Option<T>::unwrap
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/option.rs:386:21
   4: feather_server::systems::view::send_new_chunks
             at /home/lukas/rust/feather/feather/server/src/systems/view.rs:43:22
   5: core::ops::function::FnMut::call_mut
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/ops/function.rs:150:5
   6: feather_ecs::system::GroupBuilder<Input,State>::make_function::{{closure}}
             at /home/lukas/rust/feather/feather/ecs/src/system.rs:193:13
   7: <alloc::boxed::Box<F,A> as core::ops::function::FnMut<Args>>::call_mut
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/alloc/src/boxed.rs:1335:9
   8: feather_ecs::system::SystemExecutor<Input>::run
             at /home/lukas/rust/feather/feather/ecs/src/system.rs:144:26
   9: feather_server::create_tick_loop::{{closure}}
             at /home/lukas/rust/feather/feather/server/src/main.rs:91:9
  10: <alloc::boxed::Box<F,A> as core::ops::function::FnMut<Args>>::call_mut
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/alloc/src/boxed.rs:1335:9
  11: feather_common::tick_loop::TickLoop::run
             at /home/lukas/rust/feather/feather/common/src/tick_loop.rs:25:31
  12: feather_server::run
             at /home/lukas/rust/feather/feather/server/src/main.rs:85:5
  13: feather_server::main::{{closure}}
             at /home/lukas/rust/feather/feather/server/src/main.rs:31:5
  14: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/future/mod.rs:80:19
  15: tokio::park::thread::CachedParkThread::block_on::{{closure}}
             at /home/lukas/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.2.0/src/park/thread.rs:263:54
  16: tokio::coop::with_budget::{{closure}}
             at /home/lukas/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.2.0/src/coop.rs:121:9
  17: std::thread::local::LocalKey<T>::try_with
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/thread/local.rs:272:16
  18: std::thread::local::LocalKey<T>::with
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/thread/local.rs:248:9
  19: tokio::coop::with_budget
             at /home/lukas/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.2.0/src/coop.rs:114:5
  20: tokio::coop::budget
             at /home/lukas/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.2.0/src/coop.rs:98:5
  21: tokio::park::thread::CachedParkThread::block_on
             at /home/lukas/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.2.0/src/park/thread.rs:263:31
  22: tokio::runtime::enter::Enter::block_on
             at /home/lukas/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.2.0/src/runtime/enter.rs:151:13
  23: tokio::runtime::thread_pool::ThreadPool::block_on
             at /home/lukas/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.2.0/src/runtime/thread_pool/mod.rs:71:9
  24: tokio::runtime::Runtime::block_on
             at /home/lukas/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.2.0/src/runtime/mod.rs:452:43
  25: feather_server::main
             at /home/lukas/rust/feather/feather/server/src/main.rs:18:1

Your Environment

  • Operating System: Debian
  • Operating System Version: Debian GNU/Linux 10 (buster)
  • Feather Version: On commit b63fd95
@DeusFerrariis
Copy link

Could you provide a repo with the pyCraft code used to produce this bug?

@oxkitsune
Copy link
Member

Hey, thanks for the report! Did you compile in release mode? Also how many clients were connecting/reconnecting and what was the delay between these actions?

@Seadragon91
Copy link
Author

The crash also occurs on release mode. I added a run file for pyCraft here:
https://github.com/Seadragon91/pyCraft/blob/feather/run_connect_reconnect.py.

I changed online_mode to false and changed max_players to 100. That are also how many clients are connecting and reconnecting.

@Seadragon91
Copy link
Author

Was also able to reproduce it under windows in debug and release mode.

@FussballAndy FussballAndy mentioned this issue Jun 28, 2021
6 tasks
@Seadragon91
Copy link
Author

Fixed by #440.

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