Jeff Martin on Nostr: Small update for the SmolWeb network: Host connections to the beacon server would ...
Small update for the SmolWeb network:
Host connections to the beacon server would eventually die for some reason, usually after several days of perfectly good uptime. Apparently the TCP keep-alives weren't enough to keep the network connection going.
This resulted in a weird case where the host would try to reconnect to the beacon but would get rejected because the beacon thought it still had a connection for that host. That ended up being a terminal state, so the host could never reconnect and would be offline permanently. Not great.
To fix it, I had to add an application-level keep-alive so the beacon server would actively look for broken connections and prune them. Typical ping pong stuff, nothing fancy, but it seems to work ok for now.
Hosts have already been able to reconnect to beacons after all kinds of network disruptions. Like either side rebooting (say, after automatic OS updates).
But now, hosts can recover from mysterious TCP connection deaths too.
Hopefully that means my host will stay online for weeks at a time now without me needing to poke things anymore. We'll see what happens.
Published at
2024-11-17 17:20:05Event JSON
{
"id": "be7e83596e9f826308559a710c0a4f45485a4f1d225cb3bad162f1f8f9748751",
"pubkey": "4b06a99655066ca3e1a19ecc4bd5c5fd5d0f106a319a8cfb3c414bdff9e17c27",
"created_at": 1731864005,
"kind": 1,
"tags": [
[
"emoji",
"blobcatgooglyshrug",
"https://files.gladtech.social/custom_emojis/images/000/005/749/original/74694c72049cc401.png"
],
[
"emoji",
"blobcatfacepalm2",
"https://files.gladtech.social/custom_emojis/images/000/009/538/original/51bb564d1b7b1f1d.png"
],
[
"emoji",
"blobcatcheer",
"https://files.gladtech.social/custom_emojis/images/000/005/770/original/175948d0ec8fa056.png"
],
[
"proxy",
"https://gladtech.social/users/cuchaz/statuses/113499439492399124",
"activitypub"
]
],
"content": "Small update for the SmolWeb network:\n\nHost connections to the beacon server would eventually die for some reason, usually after several days of perfectly good uptime. Apparently the TCP keep-alives weren't enough to keep the network connection going. :blobcatgooglyshrug: \n\nThis resulted in a weird case where the host would try to reconnect to the beacon but would get rejected because the beacon thought it still had a connection for that host. That ended up being a terminal state, so the host could never reconnect and would be offline permanently. Not great. :blobcatfacepalm2: \n\nTo fix it, I had to add an application-level keep-alive so the beacon server would actively look for broken connections and prune them. Typical ping pong stuff, nothing fancy, but it seems to work ok for now.\n\nHosts have already been able to reconnect to beacons after all kinds of network disruptions. Like either side rebooting (say, after automatic OS updates).\n\nBut now, hosts can recover from mysterious TCP connection deaths too. :blobcatcheer: \n\nHopefully that means my host will stay online for weeks at a time now without me needing to poke things anymore. We'll see what happens.",
"sig": "5fa17e025b52b47f4adc6c2c5d0a8f9643029f29099473ea99576b57ac11e48a7ebd9c205ba1eab5a9b36373609712d446a9f69711a78b2ca1f89389dad42cf1"
}