The client will also get an error code when sending the data and the same peer will then reconnect right after (I have not found the code for this yet) leading to log message: relay/server/relay.go:129: peer connected from: 172.23.0.1:39226
The lsof has now increased by one sudo docker exec netbird-relay-0-1 lsof | wc -> 801
When the lsof of the docker container reaches 1000 it will stop accepting new connections and the docker container must be restarted
Solved by #2879
Potential Relay server bug - Saturating number of connections on EOF websocket error: Hopefully I just misunderstand something:
Scenario:
Many peers with high ping and low internet speed
Background:
Hosting relay server behind nginx reverse proxy
Reproduction
sudo docker exec netbird-relay-0-1 lsof | wc
-> 800relay/server/peer.go:61: failed to read message: failed to get reader: failed to read frame header: EOF
it will return the Work code in https://github.com/netbirdio/netbird/blob/b4d7605147e6ddbd22c214b42ef43267bc78ce80/relay/server/peer.go#L48-L64 Which in turn result in removing deleting the peer from store inRelay.go
file https://github.com/netbirdio/netbird/blob/b4d7605147e6ddbd22c214b42ef43267bc78ce80/relay/server/relay.go#L134-L139 and logsrelay/server/relay.go:137: relay connection closed
relay/server/relay.go:129: peer connected from: 172.23.0.1:39226
sudo docker exec netbird-relay-0-1 lsof | wc
-> 801Potential fix? -> Run
p.conn.Close()
inside https://github.com/netbirdio/netbird/blob/b4d7605147e6ddbd22c214b42ef43267bc78ce80/relay/server/peer.go#L48-L64 whenever an error is met?Full log example showcasing that the peer_id is same:
Can mention that I also observe that whenever a client is gracefully shut down or healtcheck timeout leads to a reduction of connected sockets.