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

Already on GitHub? Sign in to your account

Map dir_from_to turn timed outs #1

Open
mj41 opened this Issue Dec 5, 2011 · 1 comment

Comments

Projects
None yet
1 participant
Owner

mj41 commented Dec 5, 2011

Map.pm method dir_from_to (using AI::Pathfinding::AStar) time outs occasionally.
But t/turntime.t is passing. Any ideas?

cd ../aiants
utils/use-example-bot.sh bots/HungryBot.pm
Copying bots/HungryBot.pm to MyBot.pm

utils/run-local.sh 200
turn 73
...
--- go send in 96.826 ms

turn 74
...

Bot 1 error output:
turn 74 bot 0 timed out 1323117204.237155 1323117204.134734 0.100000

cd ../aichallenge(epsilon)
git diff

diff --git a/worker/engine.py b/worker/engine.py
index eec97ee..df9da96 100644
--- a/worker/engine.py
+++ b/worker/engine.py
@@ -421,7 +421,7 @@ def get_moves(game, bots, bot_nums, time_limit, turn):
# kill timed out bots
for b, finished in enumerate(bot_finished):
if not finished:

  •        error_lines[b].append(unicode('turn %4d bot %s timed out') % (turn, bot_nums[b]))
    
  •        error_lines[b].append(unicode('turn %4d bot %s timed out %f %f %f') % (turn, bot_nums[b],  time.time(), start_time, time_limit))
         statuses[b] = 'timeout'
    
Owner

mj41 commented Jan 2, 2012

Maybe related to:

Here, signals are used to put a time limit on some action. However sometimes this doesn't work as wanted. In particular, some C libraries used in XS modules don't honor the deferred signaling resulting in it being ignored until the C function has finished, which is unlikely to be what you want.
http://blogs.perl.org/users/leon_timmermans/2012/01/what-you-should-know-about-signal-based-timeouts.html

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