Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOD event can be provided to user before NEW event #16

Open
dankamongmen opened this issue Nov 1, 2019 · 0 comments
Open

MOD event can be provided to user before NEW event #16

dankamongmen opened this issue Nov 1, 2019 · 0 comments
Assignees
Labels
bug shit's fucked up
Milestone

Comments

@dankamongmen
Copy link
Owner

Imagine the following interleaving:

  • we subscribe to iface events
  • we request a dump of ifaces
  • we get a modification event to some iface N
  • we get the dump result for N

currently, this would result in the user seeing a MOD followed by a NEW. maybe that's no problem. in that case MOD vs NEW seems a useless thing to distinguish, and we ought not provide this semantic. if it is useful, we need to avoid this. we don't want to just drop the MOD. either we could present the MOD as a NEW, and drop the dump result, or we can hold the MOD until we get the dump result, and then send them both.

this last seems a lot of state for not much value. i say we pass along the MOD and drop the dump result. simply failing to distinguish means that we would send the MOD followed by the NEW, meaning the user possibly ends up with stale state. there are orderings where the NEW would have more up-to-date information than a MOD that came before it, but all such situations seem to require a change following our request for a dump, which will generate a new MOD event with the up-to-date information.

so i think the way forward is:

  • eliminate the mod vs new distinction, there is only "event" and "delete event"
    ** this has other benefits regarding dropped messages and the weird semantics of "new" for devices that existed before we started
  • pass along all MOD messages
  • only pass along dump messages if we've never seen a message about this device

to be completely robust, this last line (filter dumps if we've sent a message about this device) need to take into account delete events. consider this ordering:

  • subscribe to events
  • request dump
  • dump is filled in
  • device is deleted, we get delete event about unknown device
  • dump is returned, we get event about device that no longer exists

this is solved by treating DEL exactly like MOD for purposes of dump response handling, though it does require some annoying state we wouldn't otherwise need (to track deleted objects, at least up through the dump response).

a lot of effort to handle race conditions on initialization :(. gotta do it, though.

@dankamongmen dankamongmen self-assigned this Nov 1, 2019
@dankamongmen dankamongmen added the bug shit's fucked up label Nov 1, 2019
@dankamongmen dankamongmen added this to the 1.0.0 milestone Nov 1, 2019
dankamongmen added a commit that referenced this issue Nov 1, 2019
Eliminate NEW event, pass evtype through to callbacks,
and handle DEL events
@dankamongmen dankamongmen changed the title Mod event can be provided to user before New event MOD event can be provided to user before NEW event Nov 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug shit's fucked up
Projects
None yet
Development

No branches or pull requests

1 participant