Created
July 21, 2013 15:48
-
-
Save cwebber/6048931 to your computer and use it in GitHub Desktop.
debugging data on actors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/xudd/hive.py b/xudd/hive.py | |
| index e9bc0d0..3987aed 100644 | |
| --- a/xudd/hive.py | |
| +++ b/xudd/hive.py | |
| @@ -67,6 +67,7 @@ class HiveWorker(Thread): | |
| # We didn't do anything this round, oh well | |
| return False | |
| + print("%s got actor %s" % (self, actor)) | |
| # Process messages from this actor | |
| messages_processed = 0 | |
| while self.max_messages is None \ | |
| @@ -85,6 +86,7 @@ class HiveWorker(Thread): | |
| actor.handle_message(message) | |
| messages_processed += 1 | |
| + print("Is %s in queue already?: %s" % (actor, actor in self.hive.actor_queue.queue)) | |
| # Request checking if actor should be requeued with hive | |
| self.hive.request_possibly_requeue_actor(actor) | |
| @@ -105,6 +107,7 @@ class Hive(Thread): | |
| # Actor queue | |
| self.__actor_queue = Queue() | |
| + self.actor_queue = self.__actor_queue | |
| self.num_workers = num_workers | |
| self.__workers = [] | |
| @@ -224,6 +227,7 @@ class Hive(Thread): | |
| # Should we requeue? | |
| if not actor.message_queue.queue.empty(): | |
| # Looks like so! | |
| + print("requeueing %s" % actor) | |
| self.queue_actor(actor) | |
| elif action_type == "queue_message": |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Curiously, the above is in python 3. In python 2, the "in queue already" problem doesn't appear to be so:
note that there's no block=True in this verison.
The python 2 version doesn't seem to be hitting the same bug!
However, something still seems wrong: it doesn't make sense that the DepartmentChair (of which there is only one) would be being wrapped up twice after the "shutting down" message, unless this is some threading goofiness in python and it's just printing out of order. At the time that the last experiment is received, that message should only appear one more time and then it should be over and done with.