Xpra: Ticket #251: server uses 100% CPU with old versions of Python

This triggers more often in 0.8.x because we try to launch pulseaudio by default if sound is enabled, but this has nothing to do with sound: you can also trigger this bug with:

xpra start :10 --start-child=ls

'ls' will terminate and send python into a 100% CPU spin.

That's because we register a SIGCHLD handler in order to support the --exit-with-children flag, and this interferes with subprocess.Popen in mysterious ways.

This is a known issue in Python versions 3.0 and 2.6 and older, only versions 2.7 and 3.1 onwards have the fix, more details this twisted bug.

All sorts of workarounds are suggested, but none of them seem to work here (at least not without significant code changes - which I am very reluctant to do simply to support broken versions of python):

etc..

Note: this is not the same as the 100% cpu bug in pygtk which you can find this other 100% cpu bug (although this one probably shared the same underlying cause).



Fri, 08 Feb 2013 11:23:41 GMT - Antoine Martin: status changed; resolution set

r2683 cleans up this mess: if you use a buggy Python version and --exit-with-children then you will end up using polling, all other cases end up with cleaner/better code.

We will not be held hostage by already fixed bugs!


Sat, 09 Feb 2013 04:58:08 GMT - Antoine Martin: description changed


Sat, 23 Jan 2021 04:49:38 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/251