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

Piotr.Murach pogamut-forum at diana.ms.mff.cuni.cz
Fri Jul 23 17:15:49 CEST 2010


Re: Bot state change to dead freezes code execution.

Author: Piotr.Murach

Hi,

I terms of experimental set up I am doing it almost in similar way to Jacob's advice in "experimental setup" topic, killing and starting the ucc server and then connecting bots and again in circles.	

The message with bot state switched to dead is issued in each of the runs, but it hungs only once :) 

In each run after the agents are stopped and platform is about to shutdown this warning is issued:

(ThiefBot)    [WARNING] 22:29:50.796                                                          In-Logic-Thread Stopping happens. This occurs whenever the LogicModule is being stopped from within its own thread. While this may proceed as you have expected, it is unsupported operation with uncertain result.
It is adviced to perform the troubling operation in different thread, e.g.:
    new Thread(new Runnable() {
        @Override
        public void run() {
            // do something that happens to stop the logic module //
        }
    }).start();

Do you think that I should set this.bot.stop in separate thread?

Next during stopping the ucc server the following is always issued:

(ThiefBot)    [WARNING] 22:29:18.467    Component UT2004Bot[ThiefBot] has stopped.
(ThiefBot)    [WARNING] 22:29:18.467    All agent's components has stopped. Stopping agent as well.
(ThiefBot)    [WARNING] 22:29:18.467                                                           Unregistering JMX components.
(ThiefBot)    [WARNING] 22:29:18.561                                                           Thread 0: stopping the thread, received ComponentNotRunningException from UT2004SyncLockableWorldView.
(ThiefBot)    [WARNING] 22:29:18.561                                                           Thread 0: Logic thread stopped.
(ThiefBot)    [SEVERE]  22:29:18.561    Killing agent ThiefBot2-2@
(ThiefBot)    [SEVERE]  22:29:18.561                                                                  Fatal error happenned - component bus is stopping.
FatalErrorEvent[
    Component=UT2004Bot[ThiefBot]
    Message=agent kill() requested
    Stacktrace:
        cz.cuni.amis.pogamut.base.component.bus.event.ComponentBusEvents.fatalError(ComponentBusEvents.java:98)
        cz.cuni.amis.pogamut.base.agent.impl.AbstractAgent.kill(AbstractAgent.java:517)
        servers.tbcs.ThiefBotControlServer.runServerOnceForParameters(ThiefBotControlServer.java:214)
        servers.tbcs.ThiefBotServerTask.performTask(ThiefBotServerTask.java:42)
        servers.ServerSynchronisationTask.runGameServer(ServerSynchronisationTask.java:42)
        servers.GameBotServer.run(GameBotServer.java:22)
]

This points to the place in my code where I do something like:

IAgent agent = botRunner.startAgent();

// Wait until the bot finishes and close Pogamut platform.
new WaitForAgentStateChange(agent.getState(), IAgentStateStopped.class).await();
agent.kill(); /// THIS IS THE THIEFBOTCONTROLSERVER : 214
Pogamut.getPlatform().close();

Do you think this could be potentially the problem, stack overflowing error?

Another thing i was thinking that there may be loads of objects that are not gc'ed after each run of the bot finally 
stuffing the jvm to its limit?

My experimental setup is this:
1. map CTF-1on1-Joust, no mutators 
2. two bots set on the opposite sides
3. my bot runs are of fixed length of actions and after the sequence ends a stop message is issued, so each experiment roughly should have the same length of execution
4. if the bot dies during the sequence execution it does not get anymore commands, just respawns and stands still till 
the sequence runs out, and then the stop is called
5. this needs to be performed let us say 2000 times to get some reasonable results

Please follow-up if anything is unclear! It really is awesome that are going to run these test. On my side I will try to 
get some JVM debugging tool to see exactly when and if things get filled up.

One final thing, if you feel that this would help in writing test cases etc, I could upload my code to a repository so you
can have a look? If yes, please could you provide me with your private email...

Thank you a lot,

P.

-- 
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