[Pogamut-list] Bot state change to dead freezes code execution.

jakub.gemrot pogamut-forum at diana.ms.mff.cuni.cz
Thu Jul 22 10:22:08 CEST 2010


Re: Bot state change to dead freezes code execution.

Author: jakub.gemrot

Hi!

Do not mention patronising, if something does not behave as you would expect it in Pogamut, we're here to help!

I'm currently at work, so I can't dig deep into the Pogamut, but I will try to explain what the BusAwareCountDownLatch exception is and why the latch is present in the UT2004Bot hopefully pointing you somewhere, where the original bug is, as InterruptedException alone is not a problem - it was actually triggered due to an exception somewhere else.

So, whenever UT2004Bot agent is starting (at the line IAgent agent = botRunner.startAgent();), it must wait for the handshake between bot and GB2004 (== initial communication where navigation graph, items, item classes, players, etc. are exported) so your logic start in the point where UT2004Bot is fully initialized (as we're deploying multi-threaded model, there is no other way than to use something like latches). So the UT2004Bot is starting, this means that its mediator thread (thread that is constantly parsing messages from GB2004 stuffing it into the world view) crunching the handshake. UT2004Bot.startAgent() (your thread) is waiting for this to finish. Now our bug we're pursuing steps in, that throws an exception somewhere in the Pogamut that happens to propagate fatal error event through the UT2004Bot's component bus, tearing the whole system down == interrupting the latch (as it is bus aware one) ultimately resulting in throwing the exception you've posted.

There are a few reasons that might cause that:
1) the GB2004 fails to behave as expected, exporting some strange message at certain point of handshake resulting in the exception
2) the END message was not received by the bot in 60secs (the UT2004Bot is not the only one waiting for the first batch of infos, UT2004BotLogic is doing that too)
3) one of our modules' (i.e., Players, Weaponry, Items) listeners fails to process some event, throwing an exception
4) one of your listeners fails to process some event, throwing an exception

In any way, there should be another exception logged prior the interrupted exception you've posted (generally, it is always the best to find the first exception that is logged as it usually triggers many more in the whole Pogamut system, while the agent is being torn down).

Could you see the logs again whenever it happens next time?

Hope this helps somehow....

Cheers!
Jimmy

P.S.: the CountDownLatch is not used whenever the bot dies, so there can't be racing conditions due to this latch, this latch is used only during start up of the UT2004Bot

-- 
Reply Link: <http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?forumId=4&comments_reply_threadId=4&comments_parentId=293&post_reply=1#form>





More information about the Pogamut-list mailing list