*: Update to libp2p v0.32.0 (#7696)

* *: Update to libp2p v0.32.0

* Cargo.lock: Update async-tls to 0.10.2

* client/network/request_response: Adjust to new request response events

* client/network/request_response.rs: Clean up silently failing responses

* client/network/discovery: Lazily instantiate mdns

* client/network/discovery: Exclude MdnsWrapper for target_os unknown

* client/network/discovery: Fix indentation

* client/network/request-response: Use LruCache to track pending resp time

* client/network/request_responses: Fix early connection closed error

* client/network/request-response: Replace debug_assert with debug

* client/network/request-response: Fix typo

* client/network/request-response: Don't emit event on send_response fail

* client/network/request-response: Revert waker.wake_by_ref()

* client/network/request-resp: Make duration in InboundRequest optional

* client/network/req-resp: Don't emit two events for busy builder

When a response builder is busy incoming requests are dropped.
Previously this was reported both via a `ResponseFailure::Busy` and a
`ReponseFailure::Network(InboundFailure::Omisssion)` event.

With this commit the former is removed, leaving only the latter in
place.
This commit is contained in:
Max Inden
2020-12-09 22:58:22 +01:00
committed by GitHub
parent b29d6092c2
commit 0a2636d20c
14 changed files with 225 additions and 131 deletions
+6 -4
View File
@@ -1373,19 +1373,21 @@ impl<B: BlockT + 'static, H: ExHashT> Future for NetworkWorker<B, H> {
Poll::Ready(SwarmEvent::Behaviour(BehaviourOut::InboundRequest { protocol, result, .. })) => {
if let Some(metrics) = this.metrics.as_ref() {
match result {
Ok(serve_time) => {
Ok(Some(serve_time)) => {
metrics.requests_in_success_total
.with_label_values(&[&protocol])
.observe(serve_time.as_secs_f64());
}
// Response time tracking is happening on a best-effort basis. Ignore
// the event in case response time could not be provided.
Ok(None) => {},
Err(err) => {
let reason = match err {
ResponseFailure::Busy => "busy",
ResponseFailure::Network(InboundFailure::Timeout) => "timeout",
ResponseFailure::Network(InboundFailure::UnsupportedProtocols) =>
"unsupported",
ResponseFailure::Network(InboundFailure::ConnectionClosed) =>
"connection-closed",
ResponseFailure::Network(InboundFailure::ResponseOmission) =>
"busy-omitted",
};
metrics.requests_in_failure_total