Skip to content

ei: keep a cache of defunct objects to avoid spamming the log

Peter Hutterer requested to merge whot/libei:wip/handle-invalid-object-ids into main

Because of the asynchronous protocol, we may get this interaction

  • server sends A->destroyed()
    • client sends A->foo()
    • client receives A->destroyed()
  • server receives A->foo()
  • server sends invalid_object_id(A)
    • client receives invalid_object_id(A)

Previously we dropped the object after destroyed() and were thus guaranteed to warn about the invalid object id for that same object later.

Fix this by keeping a cache of defunct object IDs that we know about and ignoring errors for recently dropped objects.

Every 20 ei_dispatch() calls we drop any defunct objects that were unregistered more than 5 seconds ago.

Fixes #49 (closed)


This sits on top of !269 (merged)

cc @pnowack

Edited by Peter Hutterer

Merge request reports