slow completion for systemd units

Bug #1529152 reported by Karl-Philipp Richter
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
systemd
Fix Released
Unknown
bash-completion (Ubuntu)
Invalid
Undecided
Unassigned
Xenial
Invalid
Undecided
Unassigned
Bionic
Invalid
Undecided
Unassigned
systemd (Ubuntu)
Fix Released
Medium
Dan Streetman
Xenial
Won't Fix
Undecided
Unassigned
Bionic
Fix Released
Medium
Dan Streetman

Bug Description

[impact]

systemctl tab completion is annoyingly slow.

[test case]

on a bionic system:

$ systemctl status systemd-<tab>

any unit can be used, or even <tab> before specifying any unit name chars.

That will hang for sometimes a few seconds.

[regression potential]

this updates systemctl bash completion, so any regression would likely result in systemctl command misbehaving; most likely, failure to tab-complete.

[scope]

This is needed for Bionic and Xenial, however I am not currently planning to fix this for Xenial.

This is fixed by upstream commit f28255e2d5695b0d060558ff8cbb2b526fc94cc0 and a few other previous commits, which are all included starting in v240, so this is fixed already in Eoan and later.

[original description]

Pressing <kbd>Tab</kbd> after entering `sudo systemctl status [existing service name without .service suffix]` into console it takes up to 5 seconds until the auto-completion completes. Until then the cursor can't be moved.

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: bash-completion 1:2.1-4.1ubuntu2
Uname: Linux 4.2.5-040205-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
ApportVersion: 2.19.1-0ubuntu5
Architecture: amd64
Date: Thu Dec 24 21:04:41 2015
InstallationDate: Installed on 2015-04-20 (248 days ago)
InstallationMedia: Ubuntu-Server 14.10 "Utopic Unicorn" - Release amd64 (20141022.2)
PackageArchitecture: all
ProcEnviron:
 TERM=screen
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: bash-completion
UpgradeStatus: Upgraded to wily on 2015-10-26 (59 days ago)

Revision history for this message
Karl-Philipp Richter (krichter722) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bash-completion (Ubuntu):
status: New → Confirmed
Revision history for this message
Machiel van Veen (machielvanveen) wrote :

This is still an issue in 18.04 however, it seems finally fixed in 18.10, the systemd developers do say it has been since systemd version 240.

If at all possible it would be great if this can be backported for 18.04 considering the length of support.

Revision history for this message
Dan Streetman (ddstreet) wrote :
Changed in systemd (Ubuntu):
status: New → Fix Released
importance: Undecided → Medium
Changed in systemd (Ubuntu Bionic):
importance: Undecided → Medium
Changed in bash-completion (Ubuntu):
status: Confirmed → Invalid
Changed in bash-completion (Ubuntu Bionic):
status: New → Invalid
Changed in systemd (Ubuntu):
assignee: nobody → Dan Streetman (ddstreet)
Changed in systemd (Ubuntu Bionic):
assignee: nobody → Dan Streetman (ddstreet)
status: New → In Progress
Changed in systemd:
status: Unknown → Fix Released
Revision history for this message
Dan Streetman (ddstreet) wrote :

This needs commits c839b729c5f7b08f6d91bf9567d0b1f91d17e0f7 and f28255e2d5695b0d060558ff8cbb2b526fc94cc0, but appears to also need additional commits, as a quick test shows it's no longer autocompleting all units after only those 2 commits.

Dan Streetman (ddstreet)
description: updated
Dan Streetman (ddstreet)
description: updated
Changed in systemd (Ubuntu Xenial):
status: New → Won't Fix
Changed in bash-completion (Ubuntu Xenial):
status: New → Invalid
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Karl-Philipp, or anyone else affected,

Accepted systemd into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/237-3ubuntu10.41 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in systemd (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (systemd/237-3ubuntu10.41)

All autopkgtests for the newly accepted systemd (237-3ubuntu10.41) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:

python-dbusmock/unknown (armhf)
policykit-1/unknown (armhf)
multipath-tools/unknown (armhf)
debci/unknown (ppc64el)
netplan.io/0.99-0ubuntu3~18.04.1 (i386)
pdns-recursor/unknown (armhf)
umockdev/0.11.1-1 (armhf)
sssd/unknown (armhf)
linux-raspi2-5.3/unknown (armhf)
suricata/unknown (armhf)
lxc/unknown (armhf)
casync/2+61.20180112-1 (s390x)
openssh/1:7.6p1-4ubuntu0.3 (arm64, s390x, amd64, i386, ppc64el, armhf)
python-systemd/unknown (armhf)
puppet/unknown (armhf)
prometheus-postgres-exporter/unknown (armhf)
lxc/3.0.3-0ubuntu1~18.04.1 (arm64)
postgresql-10/unknown (armhf)
polkit-qt-1/unknown (armhf)
munin/unknown (armhf)
systemd/237-3ubuntu10.41 (armhf)
pulseaudio/unknown (armhf)
php7.2/unknown (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/bionic/update_excuses.html#systemd

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Dan Streetman (ddstreet) wrote :

it's difficult to show exact timing of the tab-completion, but i tested with the pkg in proposed, and it does seem significantly faster, so marking this as verified.

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 237-3ubuntu10.41

---------------
systemd (237-3ubuntu10.41) bionic; urgency=medium

  [ Dan Streetman ]
  * d/p/lp1867375/0001-network-Allow-to-configure-GW-even-UseRoutes-false.patch,
    d/p/lp1867375/0002-network-add-a-flag-to-ignore-gateway-provided-by-DHC.patch,
    d/p/lp1867375/0003-network-change-UseGateway-default-to-UseRoutes-setti.patch:
    - Move gateway ignoring from UseRoutes= to UseGateway= (LP: #1867375)
   * d/p/lp1873607/0002-core-make-sure-to-restore-the-control-command-id-too.patch:
     - Avoid segfault during serialization (LP: #1873607)
   * d/p/lp1529152/0001-bash-completion-systemctl-use-systemctl-no-pager.patch,
     d/p/lp1529152/0002-bash-completion-systemctl-pass-current-partial-unit-.patch,
     d/p/lp1529152/0003-shell-completion-systemctl-pass-current-word-to-all-.patch,
     d/p/lp1529152/0004-bash-completion-systemctl-re-implement-__filter_unit.patch,
     d/p/lp1529152/0005-strip-value-from-property-names.patch:
     - fix slow systemctl tab completion (LP: #1529152)
   * d/p/lp1877159-networkd-fix-attribute-length-for-wireguard-10380.patch:
     - avoid kernel err msg setting wireguard param (LP: #1877159)

  [ Heitor Alves de Siqueira ]
  * d/p/lp1876600-sd-bus-deal-with-cookie-overruns.patch:
    - deal with dbus cookie overruns (LP: #1876600)

 -- Heitor Alves de Siqueira <email address hidden> Sun, 03 May 2020 11:30:25 +0000

Changed in systemd (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for systemd has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.