question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Stale peers can't be removed

See original GitHub issue

What happened?

If a peer has not connected in a long time, “chia show -r peer_id” does not remove it.

Example:

FULL_NODE <removed>                          40698/8444  23cf14b6... Nov 06 15:45:25     13.7|1.2    
                                                 -SB Height:  1104692    -Hash: 9476b861...
FULL_NODE <removed>                          43361/8444  4528e678... Nov 06 11:09:24      0.2|0.0    
                                                 -SB Height:   644118    -Hash: 759b23eb...

First node is shown for reference of current height and time. Second node is far behind and last contact was more than 4 hours ago.

If I then execute “chia show -r 4528e678”, that peer is not removed from the table. With INFO level logging, nothing is recorded in the log. If I execute a remove via RPC call, the return is {“success”: true} however, the peer is still not removed.

Version

1.2.11

What platform are you using?

Linux

What ui mode are you using?

CLI

Relevant log output

N/A

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:21 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
iliasorazovcommented, Dec 23, 2021

There is a race condition. The ChiaServer class is creating a WSChiaConnection passing self.connection_closed callback to its init method. Then it calls self.connection_added(connection, ...) adding connection to the list of peers. Connection may have been closed in between and thus it is leaving an already closed connection in the list.

The WSChiaConnection.close method only calls close_callback once.

https://github.com/Chia-Network/chia-blockchain/blob/659f4f489081939387d6704b77c4477edb278ae1/chia/server/ws_connection.py#L195-L196

this is causing the issue described. Even if you try to manually disconnect it, the close method won’t call close_callback and the connection will remain in the list.

2reactions
skweeecommented, Dec 20, 2021

If you want to get rid of the stale nodes, there is a counter-intuitive workaround: just manually add the stale node again and it will get removed. chia show -a <IP address of the stale node>:8444

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deleting stale cluster peers, ONTAP 9.1 & 9.3
I have two clusters who once had SnapMirror relationships, but we're breaking up the band. I deleted the SnapMirror relationships,
Read more >
gateway-peering-remove-stale-peers - IBM
The gateway-peering-remove-stale-peers command removes data about stale gateway peering members. A stale member is any member that is not replicating from ...
Read more >
CSCuh24040 - BGP routes not marked Stale nor ... - Cisco Bug
Symptom: BGP routes are not marked Stale and considered best routes even though the BGP session with the peer is torn down. A...
Read more >
Bug #1873521 “removing a unit leaves a stale provider entry ...
2) Having the charm clean up the resource provider would require the charm to block on unit removal until all instances are migrated....
Read more >
K84129490: Unable to delete silo due to stale reference to a ...
K84129490 : Unable to delete silo due to stale reference to a previously imported BIG-IP · List all existing silos and from the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found