Rework the timeout of the CGI script.

The previous implementation was fine to catch timeout of third-party
tools (like dot), but to good to catch timeout in Spot itself, because
Python will not deliver a SIGALRM while a native function (e.g. Spot's
translation) is running.  So we fork() the Python process, with a
parent that does nothing but wait for the termination of the child or
for an alarm.  On SIGALRM, the parent kills all children.

* wrap/python/ajax/spot.in: Adjust to fork.
* wrap/python/tests/alarm.py: New test file to test this
scenario in a more controled environment.
* wrap/python/tests/Makefile.am: Add it.
This commit is contained in:
Alexandre Duret-Lutz 2012-06-04 16:38:42 +02:00
parent 75862a3284
commit 7b7a946485
4 changed files with 86 additions and 7 deletions

4
NEWS
View file

@ -1,6 +1,8 @@
New in spot 0.9.1a:
Nothing yet.
* Bug fixes:
- The CGI script running for ltl2tgba.html will correctly timeout
after 30s when Spot's translation takes more time.
New in spot 0.9.1 (2012-05-23):