overall cleanup, more tests, fixing clashes, removing unwraps, hardening against protocol errors, prepare prio mgr to take commands from scheduler

fix async_recv and double block_on panic on Network::drop and participant::drop
include Cargo.lock from all examples
Found a bug on imbris runners with doc tests of `stream::send` and `stream::recv`
As neither a backtrace, nor tracing on runners in the doc tests seems to help, i disable them and add them as unit tests
This commit is contained in:
Marcel Märtens
2020-05-27 17:58:57 +02:00
parent a86cfbae65
commit 2a7c5807ff
28 changed files with 2932 additions and 1207 deletions

View File

@ -1010,7 +1010,6 @@ version = "0.1.0"
dependencies = [
"async-std",
"bincode",
"byteorder",
"futures",
"lazy_static",
"prometheus",

View File

@ -17,6 +17,6 @@ futures = "0.3"
tracing = "0.1"
tracing-subscriber = "0.2.3"
bincode = "1.2"
serde = "1.0"
serde = { version = "1.0", features = ["derive"] }
rand = "0.7.3"
shellexpand = "2.0.0"

View File

@ -1,5 +1,8 @@
#![feature(async_closure, exclusive_range_pattern)]
//!run with
//! (cd network/examples/fileshare && RUST_BACKTRACE=1 cargo run --profile=release -Z unstable-options -- --trace=info --port 15006)
//! (cd network/examples/fileshare && RUST_BACKTRACE=1 cargo run --profile=release -Z unstable-options -- --trace=info --port 15007)
//! ```
use async_std::{io, path::PathBuf};
use clap::{App, Arg, SubCommand};
use futures::{
@ -152,7 +155,7 @@ async fn client(mut cmd_sender: mpsc::UnboundedSender<LocalCommand>) {
cmd_sender.send(LocalCommand::Disconnect).await.unwrap();
},
("connect", Some(connect_matches)) => {
let socketaddr = connect_matches.value_of("ipport").unwrap().parse().unwrap();
let socketaddr = connect_matches.value_of("ip:port").unwrap().parse().unwrap();
cmd_sender
.send(LocalCommand::Connect(Address::Tcp(socketaddr)))
.await

View File

@ -28,7 +28,7 @@ impl Server {
let (command_sender, command_receiver) = mpsc::unbounded();
let thread_pool = ThreadPoolBuilder::new().build();
let network = Network::new(Pid::new(), &thread_pool);
let network = Network::new(Pid::new(), &thread_pool, None);
let run_channels = Some(ControlChannels { command_receiver });
(