bastion-rs / artillery

Fire-forged cluster management & Distributed data protocol
https://artillery.bastion-rs.com
Apache License 2.0
74 stars 10 forks source link

Get frequent SuspectedDown on localhost #48

Closed mosuka closed 3 years ago

mosuka commented 3 years ago

I am building an application using artillery-core by referring to the sample here.

https://github.com/bastion-rs/artillery/blob/master/artillery-core/examples/cball_infection.rs

I have successfully brought up a three-node cluster, but when I start the third node, I get frequent SuspectedDown. Even with a two-node cluster, there is no problem in the beginning, but after a few minutes, the SuspectedDown may occur. What can I do to solve this problem?

fulmicoton commented 3 years ago

The following code is suspicious. https://github.com/bastion-rs/artillery/blob/master/artillery-core/src/epidemic/state.rs#L265-L269

        let (remaining, expired): (Vec<_>, Vec<_>) = self
            .pending_responses
            .iter()
            .cloned()
            .partition(|&(t, _, _)| t < now);

Shouldn't it be the opposite? An expired element is one for which (now>deadline), which is the second argumnet.

Aren't expired and remaining inverted.

fulmicoton commented 3 years ago

Is there a plan to publish the crate?