hacking rules for callback notifications
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Won't Fix
|
Wishlist
|
Unassigned |
Bug Description
Callbacks were made available during the Liberty timeframe [1]. They have been put to use in a number of places, like [2] and [3].
Currently there's no formal convention or place where to locate callback notifications. This can represent a potential drawback where an inexperienced developer may accidentally add a duplicated notification (with exact signature) without carefully checking for existing notifications. A reviewer can also easily miss the error during code review.
This could lead to callbacks called multiple times from different places of workflow, without the callback being able to distinguish the difference: so long as callbacks are designed to be idempotent, this is fine, but if they aren't, then this could lead to unexpected results.
We should add a hacking rule that validates that a patch introducing a new notification hook, does not duplicate the exact signature of an existing notification.
Callbacks can (un)subscribe multiple times to the same resource event, and that's idempotent by design.
[1] http://
[2] https:/
[3] https:/
Changed in neutron: | |
importance: | Undecided → Wishlist |
tags: | added: low-hanging-fruit |
Changed in neutron: | |
status: | New → Confirmed |
description: | updated |
description: | updated |
Changed in neutron: | |
assignee: | nobody → Jeffrey Augustine (ja224e) |
Changed in neutron: | |
assignee: | nobody → j_king (james-agentultra) |
Changed in neutron: | |
milestone: | newton-1 → newton-2 |
Changed in neutron: | |
milestone: | newton-2 → newton-3 |
Jeffrey, thanks for taking this on. If you need clarifications, feel free to reach out.