Closed italovalcy closed 2 years ago
Great, catch @italovalcy. This is related to shared memory and dict mutability. Since this event kytos.topology.updated
on topology is mostly for broadcasting the entire topology updated, I believe we should send a new dict copy instead, it won't make it immutable, but since it's sending a copy, if new links or switches are added then it wouldn't result in this issue.
We probably need to document best practices about this since Python allows the developer to shoot themselves in the foot here. A general guideline could be, if you're sending a collection send a copy, if the collection can be too large, then only sends the ids, and then the caller query/get the ids accordingly.
Error message:
I'm not 100% about how to reproduce this error, but it just happened when I was doing performance measurements on Kytos. Environment: using docker container with
amlight/kytos:latest
, Mininet with AmLight Topo, creating 100 EVCs and simulating link failures (after start the emulation, create evcs, setup everything, wait a few seconds and issue a link down - e.g.tmux send-keys -t mn "sh ip link set down SoL2-eth5" ENTER
).