apple / swift-cluster-membership

Distributed Membership Protocol implementations in Swift
https://apple.github.io/swift-cluster-membership/
Apache License 2.0
201 stars 20 forks source link

Fix handling ping request response's nacks #14

Closed avolokhov closed 4 years ago

avolokhov commented 4 years ago

Indirect ping should always have a chance of sending a nack when target instance is unresponsive. Ping originator should have a chance to get this nack before pingReq times out.

Motivation:

For LHMultiplier to work we need to account for every .nack we receive from indirect probing. If originator's ping timeout is greater or equal to indirect ping's timeout, .nack will be sent after originator gives up waiting.

Modifications:

Fixed a bug with missed .nacks were unaccounted for. Fixed a bug with pingRequestResponse handling. Fixed a bug when missed .nack was registered on a "proxy" node instead of originator's one. Set an indirect ping timeout to be 80% from initial ping timeout.

Result:

Resolves https://github.com/apple/swift-cluster-membership/issues/6 LHMultiplier may start working. SWIM will start process .nack's correctly.

swift-server-bot commented 4 years ago

Can one of the admins verify this patch?

swift-server-bot commented 4 years ago

Can one of the admins verify this patch?

swift-server-bot commented 4 years ago

Can one of the admins verify this patch?

ktoso commented 4 years ago

@swift-server-bot add to whitelist

ktoso commented 4 years ago

Thank you! And thank you so much for bearing with the multiple repository moves... 🙇‍♂️ Looking into it right away