Open longmalx opened 1 year ago
This behaviour is indeed unintuitive and a side effect of the code design (I would have to check to be 100% sure), but there is a reason for it, and as changing it would change current users' expectations. I will look at possibly changing it in master (or documenting it) but probably not in the 4.x releases.
Currently, routes can be accepted via the API or the command line. We are unfortunately not "tagging" the source. If the route is from the API, it should remain announced, if it came from the configuration file, I agree with you position that it should be removed, the code clearly does not do this correctly.
SIGNAL control of ExaBGP was designed before we decided that we should really control the program via the API and it has seen no work since, as otherwise other daemons, such as BIRD, are way more capable. So the focus is on programmatic change.
Thanks. I guess what I'm not following is why the router being offline would affect the behavior if this is caused by the intrinsic handling of API vs configuration routes. I will have a look into this in more details later this week to see if I can work out any further hints.
Sorry, I misread the information when first replying, and agree that it is not right. Please discard my answer above.
I think the problem is that this code in peer.py is never run to action the configuration changes if the neighbor is offline:
# we are here following a configuration change
if self._neighbor:
# see what changed in the configuration
self.neighbor.rib.outgoing.replace(self._neighbor.backup_changes, self._neighbor.changes)
# do not keep the previous routes in memory as they are not useful anymore
self._neighbor.backup_changes = []
I thought I'd tried reconnecting the neighbor and this didn't resolve the RIB, but the code looks like it should.
Porting the patch to the main branch does cause a regression with the test suite there, so I can not close this issue or release a new 4.2 version until it can be investigated.
Bug Description
When a neighbor is unavailable during configuration changes, we have noticed that the adj-rib may contain routes which have been removed from the configuration. These remain even when the neighbor becomes available again.
All route changes are performed by updating exabgp.conf and issuing a reload.
To Reproduce
I have 2 configuration files (contained in exabgp.conf.zip):
I run commands to set the configuration to empty, restart, add the routes, reload, remove routes, reload
It can be seen that the neighbor which is not available has an incorrect entry in the RIB. If I repeat the test with both neighbors connected, then there is no issue.
Expected behavior
After removing all routes I would expect there to be no entries when I run 'adj-rib out' command.
Environment (please complete the following information):
Additional context
Here are the logs from a reproduction - exabgp.log: