ames: expire routes on a timer #7082
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Consider the following:
To fix that, we update the /forward-lane scry to explicitly check if the route is dead, based on the last-contact timestamp, instead of relying on the last value saved in state;
The ames driver has cached the dead lanes, and those lanes only expire on %nail gifts from arvo, but if no party sends a formal packet (e.g. the way to fix eauth communication problems has been to explicitly send a |hi) the lanes will remain there, and will send packets to nowhere.
To expire those lanes, we add a global ~m2 timers that goes over every peer and updates the lane to %dead if it has been more than ~s30 since last contact, and if so, emit a %nail gift to vere that will remove the entry from the cache—this timer will be removed in the Directed Messaging release that explicitly has a global ~m2 timer.
PS: credit to @pkova for finding this out.
PPS: draft until we get some feedback on the solution, and the migration is tested on a live ship.