One function
ActorRegistry in jodal/pykka
The author described this change as “Allow multiple unregistrations of same actor (Fix #5)”. It counts as a record because the check below fails on the code as it stood at e3e75ea2d and passes on a52c2ff01, with nothing else changed between the two runs.
Projectjodal/pykka
Fix saved2011-06-25
Sharing licenceApache-2.0 · LICENSE
Change size+9 −2
What the code was meant to do, written into the code itself as a docstring
Registry which provides easy access to all running actors. Contains global state, but should be thread-safe.
The change
| 127 | 127 | :param actor_ref: reference to the actor to unregister | |
| 128 | 128 | :type actor_ref: :class:`pykka.actor.ActorRef` | |
| 129 | 129 | """ | |
| 130 | + | removed = False | |
| 130 | 131 | with cls._actor_refs_lock: | |
| 131 | - | cls._actor_refs.remove(actor_ref) | |
| 132 | - | _logger.debug('Unregistered %s', actor_ref) | |
| 132 | + | if actor_ref in cls._actor_refs: | |
| 133 | + | cls._actor_refs.remove(actor_ref) | |
| 134 | + | removed = True | |
| 135 | + | if removed: | |
| 136 | + | _logger.debug('Unregistered %s', actor_ref) | |
| 137 | + | else: | |
| 138 | + | _logger.debug('Unregistered %s (not found in registry)', | |
| 139 | + | actor_ref) |
The check that tells the two apart
fail→pass·tests/actor_test.py::ThreadingActorTest::test_actor_can_call_stop_on_self_multiple_times
Check file tests/actor_test.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before ite3e75ea2d24238d15c466093a2b02ff19e65856d
Broken version dated2011-06-25
Modulepykka.registry
Units changedActorRegistry
Fingerprintbe0976e84255c8ae
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in jodal/pykka
- 2013-07-14ActorRef