Xpra: Ticket #2032: The spawned X server stays alive when xpra killed before a display number is assigned

The reason is that the function killing the X server is added to the Xpra exit cleanup list only after the display number is assigned, see browser/xpra/trunk/src/xpra/scripts/server.py and browser/xpra/trunk/src/xpra/scripts/server.py.



Tue, 06 Nov 2018 14:22:51 GMT - Antoine Martin: priority, status, description changed

It's not easy to change this, the kill_display function is also used for display upgrades.

I don't see how this bug is critical: don't kill xpra shortly after starting it and this won't be an issue.


Tue, 06 Nov 2018 14:29:53 GMT - berserker:

I don't see how this bug is critical

When starting Xpra, sporadically I get the following error:

xpra initialization error:

xpra_Xdummy: did not provide a display number using displayfd

Terminating Xpra does not terminate X server in this case! And you "don't see how this is critical"...


Tue, 06 Nov 2018 15:09:49 GMT - Antoine Martin:

xpra_Xdummy: did not provide a display number using displayfd

This can happen if your system is really slow. You can try to change the default timeout:

XPRA_DISPLAY_FD_TIMEOUT=30 xpra start ...

Tue, 06 Nov 2018 16:56:32 GMT - berserker:

This can happen if your system is really slow.

Well, kinda. But the question really is why it lets Xorg to continue running after the error occurs?


Mon, 12 Nov 2018 11:38:25 GMT - Antoine Martin: owner, status changed

Well, kinda.

what other possibility is there that I am missing?

But the question really is why it lets Xorg to continue running after the error occurs?

Because no-one hit that bug until now?

Fixed for me in r20968. Tested with an unreasonably low timeout value:

XPRA_DISPLAY_FD_TIMEOUT=1 python2 /usr/bin/xpra start --no-daemon -d x11

@berserker: please close if that works for you.


Tue, 13 Nov 2018 23:13:04 GMT - berserker: owner changed

what other possibility is there that I am missing?

Nothing. The system is indeed slow and on top of that users have CPU limits. This makes it easy to trigger the timeout if try to start several Xpra servers simultaneously.

please close if that works for you

Ehm... r20968 is not a fix for the bug reported, even if it solves the problem with timeouts (not checked yet).


Wed, 14 Nov 2018 05:07:06 GMT - Antoine Martin: owner changed

Ehm... r20968 is not a fix for the bug reported

It is meant to be.

even if it solves the problem with timeouts (not checked yet).

Timeouts are the only unhandled error path I could find that could cause the cleanups to be skipped.

If you can still reproduce a problem, please post the full output of:

XPRA_ALL_DEBUG=1 xpra start ....

Wed, 14 Nov 2018 10:12:21 GMT - berserker: owner changed

Replying to Antoine Martin:

Timeouts are the only unhandled error path I could find that could cause the cleanups to be skipped.

There is also Ctrl+C.


Thu, 22 Nov 2018 09:26:32 GMT - Antoine Martin: owner changed

There is also Ctrl+C.

Right. That is only a problem now because of a recent bug somewhere in python's atexit: #1943 (this used to work fine before, no idea when / what library broke it)


Fri, 30 Nov 2018 10:21:39 GMT - Antoine Martin: status changed; resolution set


Thu, 27 Dec 2018 20:43:54 GMT - Antoine Martin:

See also: #2091 which explains why we now hit the timeout more often than before.


Sat, 23 Jan 2021 05:40:20 GMT - migration script:

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