Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actorsystem is 'killable' #5

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

Actorsystem is 'killable' #5

pjz opened this issue Mar 17, 2016 · 5 comments

Comments

@pjz
Copy link
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
Copy link
Contributor

kwquick commented Mar 17, 2016

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

@kwquick
Copy link
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
Copy link
Contributor Author

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
Copy link
Contributor

kwquick commented Mar 18, 2016

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

@kwquick
Copy link
Contributor

kwquick commented Mar 21, 2016

Resolved in release 2.5.8 (https://github.com/godaddy/Thespian/releases/tag/thespian-2.5.8).

@kwquick kwquick closed this as completed Mar 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants