Skip to content

Fix printing-info never exiting without a system D-Bus - #5119

Merged
totaam merged 1 commit into
Xpra-org:masterfrom
kogeler:upstream/printing-cli-timer-cleanup
Nov 4, 2026
Merged

totaam merged 1 commit into
Xpra-org:masterfrom
kogeler:upstream/printing-cli-timer-cleanup

Conversation

@kogeler

@kogeler kogeler commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

xpra printing-info never exits when there is no system D-Bus, which is common
in containers: it prints the printer list and then hangs until interrupted.
init_printing() falls back to the CUPS polling timer, a non-daemon thread which
re-arms itself every 60 seconds. For the same reason, the printing-info check in
unit.scripts.main_test fails after its 60 second timeout on such hosts.

The command only takes a snapshot or submits a job and never uses printer change
notifications, so don't initialize them there. The client still initializes and
cleans up its own watcher.

The new test runs printing-info with an unreachable system bus and CUPS server:
it times out without this change and exits with the connection error with it.

The command only takes a snapshot or submits a job and never uses printer
change notifications, so don't initialize them: without a system D-Bus,
pycups falls back to a non-daemon polling timer which re-arms itself and
keeps the process alive.
@totaam

totaam commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

This module was also used on win32 as Print.exe:

xpra/setup.py

Lines 2896 to 2897 in 4b839ed

if printing_ENABLED:
add_console_exe("xpra/platform/printing.py", "printer.ico", "Print")

But I believe it has now been superseded by PDFIUM_Print.exe:

xpra/setup.py

Lines 2849 to 2851 in 4b839ed

if printing_ENABLED:
add_console_exe("xpra/platform/win32/pdfium.py", "printer.ico", "PDFIUM_Print")
do_add_DLLs("", "pdfium")

As used here:
command = ["PDFIUM_Print.exe", filename, printer, title]

So I'm going to merge this despite having some doubts. Thanks!

@totaam
totaam merged commit 4ec0e06 into Xpra-org:master Nov 4, 2026
0 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants