Bug 1777583 - Bash autocompletion for dnf install lags by several seconds.
Summary: Bash autocompletion for dnf install lags by several seconds.
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: bash-completion
Version: 31
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Siteshwar Vashisht
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-27 21:37 UTC by grumpey0
Modified: 2020-11-24 18:45 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: ---
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-24 18:45:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
script output with set -x while trying to do autocompletion. (90.36 KB, text/plain)
2019-11-27 21:37 UTC, grumpey0
no flags Details

Description grumpey0 2019-11-27 21:37:51 UTC
Created attachment 1640227 [details]
script output with set -x while trying to do autocompletion.

Description of problem:
Bash autocompletion for dnf install lags by several seconds. 

Version-Release number of selected component (if applicable):
1:2.8-7.fc31

How reproducible:
sudo dnf install gnome-<press tab to autocomplete>
or 
sudo dnf install firefox<press tab to autocomplete> 


Steps to Reproduce:
1. Open a terminal and attempt to autocomplete sudo dnf install <program>

Actual results:
4-6 second lag between presentation of the results

Expected results:
Results should be presented in 1-2 seconds at most. 

Additional info:
The source of the lag appears to be between: 
11116:32:16/usr/share//bash-completion/completions/dnf:_dnf_commands_helper:LINENO:/usr/bin/python3 -c 'import sys; from dnf.cli import completion_helper as ch; ch.main(sys.argv[1:])' install firefox -d 0 -q -C --assumeno --nogpgcheck^M
1116:32:20/usr/share//bash-completion/completions/dnf:_dnf_commands_helper:LINENO:echo 'firefox-pkcs11-loader-3.13.3-2.fc31.x86_64^M
firefox-x11-70.0.1-4.fc31.x86_64^M
firefox-x11-69.0.1-3.fc31.x86_64^M
firefox-wayland-70.0.1-4.fc31.x86_64^M
firefox-69.0.1-3.fc31.x86_64'^M

Issue is only observed on Bash, Zsh completion works find. 

This issue makes it easier and/or faster to use dnf search to find packages vice autocompletion on bash.

Comment 1 grumpey0 2019-12-05 12:21:02 UTC
Partial cut/paste of /usr/bin/python3 -m trace --trace -g ./completion_helper.py install firefox -d 0 -q -C --assumeno --nogpgcheck | tee ~/completionhelper.txt

There's a two second lag between 
9.22 config.py(74):         return value
11.20 base.py(167):         if solver_errors:



-------
9.22 config.py(72):         if isinstance(value, str):
9.22 config.py(74):         return value
9.22 repodict.py(129):         return (r for r in self.values() if r.enabled)
 --- modulename: repodict, funcname: <genexpr>
9.22 repodict.py(143):         return (v for k, v in self.items())
 --- modulename: repodict, funcname: <genexpr>
9.22 repodict.py(133):         return (item for item in sorted(super(RepoDict, self).items(),
9.22 base.py(161):         try:
9.22 base.py(162):             solver_errors = self.sack.filter_modules(
 --- modulename: base, funcname: sack
9.22 base.py(270):         return self._sack
9.22 base.py(163):                 self._moduleContainer, hot_fix_repos, self.conf.installroot,
 --- modulename: base, funcname: _moduleContainer
9.22 base.py(274):         if self.sack is None:
 --- modulename: base, funcname: sack
9.22 base.py(270):         return self._sack
9.22 base.py(276):         if self.sack._moduleContainer is None:
 --- modulename: base, funcname: sack
9.22 base.py(270):         return self._sack
9.22 base.py(277):             self.sack._moduleContainer = libdnf.module.ModulePackageContainer(
9.22 base.py(278):                 False, self.conf.installroot, self.conf.substitutions["arch"], self.conf.persistdir)
 --- modulename: base, funcname: conf
9.22 base.py(250):         return self._conf
 --- modulename: config, funcname: __getattr__
9.22 config.py(63):         if "_config" not in self.__dict__:
9.22 config.py(65):         option = getattr(self._config, name)
9.22 config.py(66):         if option is None:
9.22 config.py(68):         try:
9.22 config.py(69):             value = option().getValue()
 --- modulename: conf, funcname: installroot
9.22 conf.py(1075):         return _conf.ConfigMain_installroot(self)
 --- modulename: conf, funcname: getValue
9.22 conf.py(453):         return _conf.OptionString_getValue(self)
9.22 config.py(72):         if isinstance(value, str):
9.22 config.py(73):             return ucd(value)
 --- modulename: i18n, funcname: ucd
9.22 i18n.py(128):     if dnf.pycomp.PY3:
9.22 i18n.py(129):         if dnf.pycomp.is_py3bytes(obj):
 --- modulename: pycomp, funcname: is_py3bytes
9.22 pycomp.py(65):         return isinstance(o, bytes)
9.22 i18n.py(131):         elif isinstance(obj, str):
9.22 i18n.py(132):             return obj
 --- modulename: base, funcname: conf
9.22 base.py(250):         return self._conf
 --- modulename: base, funcname: conf
9.22 base.py(250):         return self._conf
 --- modulename: config, funcname: __getattr__
9.22 config.py(63):         if "_config" not in self.__dict__:
9.22 config.py(65):         option = getattr(self._config, name)
9.22 config.py(66):         if option is None:
9.22 config.py(68):         try:
9.22 config.py(69):             value = option().getValue()
 --- modulename: conf, funcname: persistdir
9.22 conf.py(1090):         return _conf.ConfigMain_persistdir(self)
 --- modulename: conf, funcname: getValue
9.22 conf.py(453):         return _conf.OptionString_getValue(self)
9.22 config.py(72):         if isinstance(value, str):
9.22 config.py(73):             return ucd(value)
 --- modulename: i18n, funcname: ucd
9.22 i18n.py(128):     if dnf.pycomp.PY3:
9.22 i18n.py(129):         if dnf.pycomp.is_py3bytes(obj):
 --- modulename: pycomp, funcname: is_py3bytes
9.22 pycomp.py(65):         return isinstance(o, bytes)
9.22 i18n.py(131):         elif isinstance(obj, str):
9.22 i18n.py(132):             return obj
 --- modulename: module, funcname: __init__
9.22 module.py(1070):         _module.ModulePackageContainer_swiginit(self, _module.new_ModulePackageContainer(allArch, installRoot, arch, persistDir))
 --- modulename: base, funcname: sack
9.22 base.py(270):         return self._sack
9.22 base.py(279):         return self.sack._moduleContainer
 --- modulename: base, funcname: sack
9.22 base.py(270):         return self._sack
 --- modulename: base, funcname: conf
9.22 base.py(250):         return self._conf
 --- modulename: config, funcname: __getattr__
9.22 config.py(63):         if "_config" not in self.__dict__:
9.22 config.py(65):         option = getattr(self._config, name)
9.22 config.py(66):         if option is None:
9.22 config.py(68):         try:
9.22 config.py(69):             value = option().getValue()
 --- modulename: conf, funcname: installroot
9.22 conf.py(1075):         return _conf.ConfigMain_installroot(self)
 --- modulename: conf, funcname: getValue
9.22 conf.py(453):         return _conf.OptionString_getValue(self)
9.22 config.py(72):         if isinstance(value, str):
9.22 config.py(73):             return ucd(value)
 --- modulename: i18n, funcname: ucd
9.22 i18n.py(128):     if dnf.pycomp.PY3:
9.22 i18n.py(129):         if dnf.pycomp.is_py3bytes(obj):
 --- modulename: pycomp, funcname: is_py3bytes
9.22 pycomp.py(65):         return isinstance(o, bytes)
9.22 i18n.py(131):         elif isinstance(obj, str):
9.22 i18n.py(132):             return obj
9.22 base.py(164):                 self.conf.module_platform_id, update_only=False, debugsolver=self.conf.debug_solver)
 --- modulename: base, funcname: conf
9.22 base.py(250):         return self._conf
 --- modulename: config, funcname: __getattr__
9.22 config.py(63):         if "_config" not in self.__dict__:
9.22 config.py(65):         option = getattr(self._config, name)
9.22 config.py(66):         if option is None:
9.22 config.py(68):         try:
9.22 config.py(69):             value = option().getValue()
 --- modulename: conf, funcname: module_platform_id
9.22 conf.py(1270):         return _conf.ConfigMain_module_platform_id(self)
 --- modulename: conf, funcname: getValue
9.22 conf.py(453):         return _conf.OptionString_getValue(self)
9.22 config.py(70):         except Exception as ex:
9.22 config.py(71):             return None
 --- modulename: base, funcname: conf
9.22 base.py(250):         return self._conf
 --- modulename: config, funcname: __getattr__
9.22 config.py(63):         if "_config" not in self.__dict__:
9.22 config.py(65):         option = getattr(self._config, name)
9.22 config.py(66):         if option is None:
9.22 config.py(68):         try:
9.22 config.py(69):             value = option().getValue()
 --- modulename: conf, funcname: debug_solver
9.22 conf.py(1126):         return _conf.ConfigMain_debug_solver(self)
 --- modulename: conf, funcname: getValue
9.22 conf.py(182):         return _conf.OptionBool_getValue(self)
9.22 config.py(72):         if isinstance(value, str):
9.22 config.py(74):         return value
11.20 base.py(167):         if solver_errors:
11.20 base.py(420):         timer()
 --- modulename: logging, funcname: __call__
11.20 logging.py(211):         diff = time.time() - self.start
11.20 logging.py(212):         msg = 'timer: %s: %d ms' % (self.what, diff * 1000)
11.20 logging.py(213):         logging.getLogger("dnf").log(DDEBUG, msg)
 --- modulename: __init__, funcname: getLogger
11.20 __init__.py(1931):     if name:
11.20 __init__.py(1932):         return Logger.manager.getLogger(name)
 --- modulename: __init__, funcname: getLogger
11.20 __init__.py(1227):         rv = None
11.20 __init__.py(1228):         if not isinstance(name, str):
11.20 __init__.py(1230):         _acquireLock()
 --- modulename: __init__, funcname: _acquireLock
11.20 __init__.py(218):     if _lock:
11.20 __init__.py(219):         _lock.acquire()
11.20 __init__.py(1231):         try:
11.20 __init__.py(1232):             if name in self.loggerDict:
11.20 __init__.py(1233):                 rv = self.loggerDict[name]
11.20 __init__.py(1234):                 if isinstance(rv, PlaceHolder):
11.20 __init__.py(1247):             _releaseLock()

Comment 2 Ben Cotton 2020-11-03 17:05:57 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Ben Cotton 2020-11-24 18:45:55 UTC
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.