Because `p2p.Server.Name()` function started returning an abbreviated
name of the node this broke the parsing of the name in order to fill in
the labels for `p2p_peers_count` metric, resulting in metrics like this:
```sh
> curl -sS localhost:9090/metrics | grep '^p2p_peers_count'
p2p_peers_count{platform="v0.79.0",type="Statusd",version="unknown"} 3
```
Caused by value returned from `Name()` to look like this:
```
Statusd/v0.79.0/linu...
```
By using `Fullname()` we are sure we are pasing all the segments.
Signed-off-by: Jakub Sokołowski <jakub@status.im>
There was another deadlock in the peer pool.
Because we made the event handler asynchrnous, another deadlock popped
up, as the loop locks the global peerpool lock before processing events.
But the handlers also take the global look, effectively resulting in the
same situation we had before, i.e the loop is not running.
THE LOOP MUST BE RUNNING AT ALL TIMES OTHERWISE THE SERVER HANGS.
There might be an issue on how we handle metrics, which causes the p2p
server to hang.
updateNodeMetrics calls a method on the p2p server, which
blocks until the server is available:
e60f425b45/vendor/github.com/ethereum/go-ethereum/p2p/server.go (L301)e60f425b45/vendor/github.com/ethereum/go-ethereum/p2p/server.go (L746)
If there's back-pressure on the peer event feed
e60f425b45/vendor/github.com/ethereum/go-ethereum/p2p/server.go (L783)
The event channel above might become while updateNodeMetrics
is called, which means is never consumed, the server blocks on publishing on
it, and the two will deadlock (server waits for the channel above to be consumed,
this code waits for the server to respond to peerCount, which is in the same
event loop).
Calling it in a different go-routine will allow this code to keep
processing peer added events, therefore the server will not lock and keep processing requests.
* Enable gometalinter on tests and fix static analysis issues
* Remove unneeded change
* Fix additional lint errors
* Add nolint directives and error checks
* Add error assertions instead of nolint directives
* Go back to using lint directive for loop.Run goroutine
* Add error check to loop.Run