Skip to content

Commit

Permalink
fix(executor): select! panic
Browse files Browse the repository at this point in the history
i never experienced this in development, but due to [tokio's select fairness](https://docs.rs/tokio/latest/tokio/macro.select.html\#fairness) a random branch will be started with initially
and since both of our branches select on Some, there's no else fallback
  • Loading branch information
Fyko committed Oct 13, 2023
1 parent 5d0a1e5 commit b70867f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions scyllax-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ scylla.workspace = true
scyllax = { version = "0.1.9-alpha.3", path = "../scyllax" }
serde_json = "1.0.107"
serde = { version = "1.0.188", features = ["derive"] }
tracing-subscriber.workspace = true
glob = "0.3.1"
tracing.workspace = true
filetime = "0.2.22"
Expand Down
5 changes: 5 additions & 0 deletions scyllax-cli/src/bin/scyllax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
use clap::Parser;
use console::style;
use scyllax_cli::Opt;
use tracing_subscriber::prelude::*;

/// runs the cli
#[tokio::main]
async fn main() {
tracing_subscriber::registry()
.with(tracing_subscriber::EnvFilter::from_default_env())
.with(tracing_subscriber::fmt::layer())
.init();
// no special handling here
if let Err(error) = scyllax_cli::run(Opt::parse()).await {
println!("{} {}", style("error:").bold().red(), error);
Expand Down
7 changes: 4 additions & 3 deletions scyllax/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl<T: QueryCollection + Clone> Executor<T> {
Ok(_) => (),
Err(e) => {
let x = TrySendError::from(e);
tracing::error!("error sending query to query runner: {:?}", x);
tracing::error!(hash = hash, "error sending query to query runner: {:?}", x);
},
};
});
Expand All @@ -153,7 +153,7 @@ impl<T: QueryCollection + Clone> Executor<T> {
Ok(result) => result,
Err(e) => Err(ScyllaxError::ReceiverError(e)),
};
tracing::debug!("joinset handle returned: {:#?}", res);
tracing::debug!(hash = hash, "joinset handle returned: {:#?}", res);

(hash, res)
});
Expand All @@ -168,7 +168,8 @@ impl<T: QueryCollection + Clone> Executor<T> {
}
}
}
}
},
else => {}
}
}
}
Expand Down

0 comments on commit b70867f

Please sign in to comment.