Red Hat Bugzilla – Bug 588089
bash command not found handling can hang on PackageKit mutual exclusion
Last modified: 2011-06-27 12:02:14 EDT
Description of problem:
I have been noticing for a while that I sometimes have bash command lines that seem to hang when I enter an invalid command... its been very annoying. Last night I decided to investigate, and what I discovered is that when an invalid command is entered, an attempt to run /usr/libexec/pk-command-not-found which I assume tries to mutually exclusively get access to the yum database. If the system is running yum at the time, or if the GUI tool has been run (or one of the background package checks is running, or indeed if another shell is having a bad command lookup at the same time) this leads to bash appearing to hang.
Worse yet, on one of my AMD 965 quad core machines, I have been noticing some sort of nasty interaction between the graphical package upgrade running and this bash interference where they both seem to hang indefinitely until I manually go in and start killing yum/packagekit processes. When I attached with gdb, both tasks were waiting on poll() which seems like it can't be good.
Version-Release number of selected component (if applicable):
How reproducible: Every time (although unsure exactly how to reproduce the situation that requires me to use kill)
Steps to Reproduce:
1. Start a GUI upgrade check (if you haven't done one in a while, otherwise might need to first do a yum clean all.)
2. Launch a Terminal and enter an invalid command
1. Starts checking
2. bash will hang after producing "Command not found."
3. In some cases the upgrade check seems to hang indefinitely thus blocking bash indefinitely
I don't expect bash to ever block... it needs a better technique for doing whatever /usr/libexec/pk-command-not-found does... since I don't know what its doing, its hard to say how to improve it... but it needs to not require the exclusive packagekit lock...
I am running a F13 beta in a "development" config with all available package updates applied.
We have to take the yum lock whilst using data from yum. It's just not possible with the current infrastructure.
[re comment#1] Then I suggest you need a way to export the data in a way that something equivalent to grep could search to supply your feature. This would require the file to be updated whenever the package list is updated, but would prevent bash from directly interacting with yum's data.
"We have to take the yum lock whilst using data from yum. It's just not possible
with the current infrastructure." is another comment from the *code's* point of view, not the users' point of view. It is unacceptable for the command line to hang simply because something else is running in the system.
Either there _is_ a way to check first whether yum is active and not hang the user, or this nicety must be withdrawn as actually impeding the user, not helping them.
"nicety: 6. delicacy of character", as in 'fragile'?
(In reply to comment #3)
> Either there _is_ a way to check first whether yum is active and not hang the
> user, or this nicety must be withdrawn as actually impeding the user, not
> helping them.
We can certainly time out the request after a few hundred milliseconds. If you're willing to supply a patch I can include it in the next release. If you join the mailing list I'm sure me or someone else can guide you how.
I had a little time this morning:
Author: Richard Hughes <email@example.com>
Date: Fri Jun 4 12:52:58 2010 +0100
cnf: Add a MaxSearchTime entry in CommandNotFound.conf and default to 2000ms
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13. 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 WONTFIX if it remains open with a Fedora
'version' of '13'.
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 prior to Fedora 13's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 13 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 please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.
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.
The process we are following is described here:
Fedora 13 changed to end-of-life (EOL) status on 2011-06-25. Fedora 13 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.
Thank you for reporting this bug and we are sorry it could not be fixed.