One function

ActorRef in jodal/pykka

The author described this change as ref: Async ask() now fails future instead of raising exception if actor is dead. It counts as a record because the check below fails on the code as it stood at e04531c8e and passes on c8bbe63ee, with nothing else changed between the two runs.

Fix saved2013-07-14
Sharing licenceApache-2.0 · LICENSE
Change size+7 4

What the code was meant to do, written into the code itself as a docstring

Reference to a running actor which may safely be passed around. :class:`ActorRef` instances are returned by :meth:`Actor.start` and the lookup methods in :class:`ActorRegistry <pykka.ActorRegistry>`. You should never need to create :class:`ActorRef` instances yourself. :param actor: the actor to wrap :type actor: :class:`Actor`

The change

8787 :param timeout: seconds to wait before timeout if blocking
8888 :type timeout: float or :class:`None`
8989
90- :raise: :exc:`pykka.Timeout` if timeout is reached
91- :raise: :exc:`pykka.ActorDeadError` if actor is not available
92- :return: :class:`pykka.Future` or response
90+ :raise: :exc:`pykka.Timeout` if timeout is reached if blocking
91+ :raise: any exception returned by the receiving actor if blocking
92+ :return: :class:`pykka.Future`, or response if blocking
9393 """
9494 future = self.actor_class._create_future()
9595 message['pykka_reply_to'] = future
96- self.tell(message)
96+ try:
97+ self.tell(message)
98+ except _ActorDeadError:
99+ future.set_exception()
97100 if block:
98101 return future.get(timeout=timeout)
99102 else:

The check that tells the two apart

failpass·tests/ref_test.py::ThreadingActorRefTest::test_ask_nonblocking_fails_future_if_actor_is_stopped

Check file tests/ref_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 ite04531c8ec29c37ab8ba28f95124207d7c01df6e
Broken version dated2013-07-14
Modulepykka.actor
Units changedActorRef
Fingerprint92a2470018eb15f8
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