[Buildbot-devel] Question on build slaves and twisted logs

Brian Warner warner-buildbot at lothar.com
Thu Aug 4 01:14:09 UTC 2005

>     I haven't seen many QNX questions on this mailing list so perhaps no
> one has tried anything with QNX yet.

Yup, I think you're treading new ground here. I've never heard of anyone
using Twisted or Python on QNX either. Hooray for hardy adventurous souls! :)

There are three Twisted files to pay attention to: twisted/python/log.py
(which defines the basic log-formatting code), twisted/python/logfile.py
(which opens the actual log files, and rotates them), and
twisted/scripts/twistd.py (the daemonizing-program which sets up the logfile
in the first place).

"logFile.rotate" is a useful thing to grep for. twistd will rotate logs in
response to SIGUSR1, so one possibility is that SIGUSR1 is colliding with
some other signal number under QNX, so the logfiles are being rotated
constantly (but maybe the rotation is skipped if the current file is empty).

logfile.Logfile.shouldRotate() is called before each write(), to see if the
file has gotten too large and needs to be rotated. The only place I can see
where QNX might do something weird is that it uses tell() when it first opens
the logfile, to figure out what the current size is. After that it just
increments self.size with the number of bytes in the new message each time it

Try adding some print messages to LogFile.rotate(), maybe with an 'import
traceback; traceback.print_stack()' to figure out who is calling it. You
might need to send these messages to a separate file instead of using
'print', if sys.stdout has been redirected to log.msg() (which would cause a
nasty infinite-recursion in the logging code).

It would also be interesting to run the Twisted test suite and see what
breaks. As far as I know, nobody's ever tried that before. Once we fix it,
could you maybe provide a buildslave to make sure it keeps working in the

hope that's useful,

More information about the devel mailing list