Skip to content

stats aren't getting updated with call to refresh #55

Open

Description

@dankamongmen

despite calling netstack_refresh_stats(), subsequent calls to netstack_iface_stats() always return the same stats we got when we initialized.

Activity

  1. added this to the 0.8.0 milestone on May 9, 2023
  2. self-assigned this
    on May 9, 2023
  3. dankamongmen commented on May 12, 2023

    @dankamongmen
    OwnerAuthor

    watching strace(), it does seem that we fire off the RTM_GETLINK message and even get IFLA_STATS64 in response. i bet the issue is that we drop messages for known ifaces, which would have all kinds of problems (won't pick up new MTU, etc.)

  4. dankamongmen commented on May 12, 2023

    @dankamongmen
    OwnerAuthor

    it looks like iface_create() just whips up a new iface for every NEW message it sees...seriously? indeed, the iface_count stat goes up by a constant amount each iteration. oy vey!

  5. dankamongmen commented on May 12, 2023

    @dankamongmen
    OwnerAuthor

    it looks like in iface_cb() we replace the existing entry in the nametrie, but we never remove the item from the iface_hash. we always insert the new iface at the head of the hash chain, so all lookups find the new one. we're of course holding a local reference to the netstack_iface. so i think what we need do is check for an existing item when we go to add into the name trie, and update that item rather than replacing it? and then free the new item.

    we can't just replace the old with the new, because someone might have a handle on it. though how do we handle locking in that case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugshit's fucked up

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions