Actorsystem is 'killable' #5

Closed
pjz opened this Issue Mar 17, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@pjz
Contributor

pjz commented Mar 17, 2016

Try running:

from thespian.actors import Actor, ActorExitRequest, ActorSystem

class Kill_The_Messenger(Actor):
    def receiveMessage(self, message, sender):
        self.send(sender, ActorExitRequest())

def main():
    asys = ActorSystem()
    ktm = asys.createActor(Kill_The_Messenger)
    asys.tell(ktm, "Test message")
    asys.tell(ktm, ActorExitRequest())

if __name__ == '__main__':
    main()

so you can see:

Traceback (most recent call last):
  File "buglet.py", line 15, in <module>
    main()
  File "buglet.py", line 12, in main
    asys.tell(ktm, ActorExitRequest())
  File "/tmp/bugl/local/lib/python2.7/site-packages/thespian/actors.py", line 497, in tell
    self._systemBase.tell(actorAddr, msg)
  File "/tmp/bugl/local/lib/python2.7/site-packages/thespian/system/simpleSystemBase.py", line 456, in tell
    self._pendingSends.append(PendingSend(self.actorRegistry['System:ExternalRequester'].address, msg, anActor))
AttributeError: 'NoneType' object has no attribute 'address'

...which I believe is caused by the receiveMessage of Kill_The_Messenger sending an ActorExitRequest as a response to the "Test Message" which causes the ActorSystem to break internal bookkeeping.

@kwquick

This comment has been minimized.

Show comment
Hide comment
@kwquick

kwquick Mar 17, 2016

Contributor

Thank you for the report. I will look into this later today.

Contributor

kwquick commented Mar 17, 2016

Thank you for the report. I will look into this later today.

@kwquick

This comment has been minimized.

Show comment
Hide comment
@kwquick

kwquick Mar 18, 2016

Contributor

Thanks again for the report and the code to exercise the issue. I have fixed the issue and incorporated your submission into the unit tests: 0be590c

This will be incorporated into the upcoming release (most likely version 2.5.8).

Contributor

kwquick commented Mar 18, 2016

Thanks again for the report and the code to exercise the issue. I have fixed the issue and incorporated your submission into the unit tests: 0be590c

This will be incorporated into the upcoming release (most likely version 2.5.8).

@pjz

This comment has been minimized.

Show comment
Hide comment
@pjz

pjz Mar 18, 2016

Contributor

Nice! Thanks for the prompt attention! I made one comment on that commit; sorry, I used to do work on code review tools for a living so it's become a bit of a habit.

Contributor

pjz commented Mar 18, 2016

Nice! Thanks for the prompt attention! I made one comment on that commit; sorry, I used to do work on code review tools for a living so it's become a bit of a habit.

@kwquick

This comment has been minimized.

Show comment
Hide comment
@kwquick

kwquick Mar 18, 2016

Contributor

You are welcome, and please please do review and comment!

Contributor

kwquick commented Mar 18, 2016

You are welcome, and please please do review and comment!

@kwquick

This comment has been minimized.

Show comment
Hide comment
Contributor

kwquick commented Mar 21, 2016

@kwquick kwquick closed this Mar 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment