Skip to content

Commit

Permalink
Upgrade dashmap to 4.0.0-rc4 to fix deadlock
Browse files Browse the repository at this point in the history
The map would deadlock if we initialized it with more than a certain
number of items on startup (on my machine, more than 15 or 16 items).
The latest RC fixes this issue:
xacrimon/dashmap#81 (comment)
  • Loading branch information
walfie committed May 24, 2020
1 parent 2972c2b commit 6601345
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async-graphql-warp = "1.4.10"
async-trait = "0.1.31"
chrono = { version = "0.4.11", features = ["serde"] }
circular-queue = "0.2.4"
dashmap = "4.0.0-rc3"
dashmap = "4.0.0-rc4"
escaper = "0.1.0"
futures = "0.3.5"
http = "0.2.1"
Expand Down
5 changes: 1 addition & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ async fn main() -> anyhow::Result<()> {
bosses_to_request_hashes_for
.iter()
.for_each(|boss| hash_inbox.request_hash_for_boss(boss));
tokio::spawn(hash_worker);

// Cleanup task that periodically:
// * removes bosses that haven't been seen in a while
Expand Down Expand Up @@ -132,10 +133,6 @@ async fn main() -> anyhow::Result<()> {
let server = tokio::spawn(warp::serve(routes).try_bind(bind_addr));

tokio::select! {
// For some reason the `hash_worker` doesn't work consistently if started with `tokio::spawn`
_ = hash_worker => {
slog::error!(log, "Hash updater ended unexpectedly");
}
_ = twitter_worker => {
slog::error!(log, "Disconnected from Twitter stream");
}
Expand Down

0 comments on commit 6601345

Please sign in to comment.