Bug 588089 - bash command not found handling can hang on PackageKit mutual exclusion
Summary: bash command not found handling can hang on PackageKit mutual exclusion
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: PackageKit
Version: 13
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Richard Hughes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-02 15:49 UTC by Place Holder
Modified: 2011-06-27 16:02 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-27 16:02:14 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Place Holder 2010-05-02 15:49:26 UTC
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
  
Actual results:
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

Expected results:
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...

Additional info:
I am running a F13 beta in a "development" config with all available package updates applied.

Comment 1 Richard Hughes 2010-05-03 14:39:23 UTC
We have to take the yum lock whilst using data from yum. It's just not possible with the current infrastructure.

Comment 2 Place Holder 2010-05-03 17:06:53 UTC
[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.

Comment 3 Thomas L. Shinnick 2010-06-03 20:49:12 UTC
"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'?

Comment 4 Richard Hughes 2010-06-03 22:24:13 UTC
(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.

Richard.

Comment 5 Richard Hughes 2010-06-04 11:53:36 UTC
I had a little time this morning:

commit 886787fdb119c4e974ef44cc1ffcb31bc0b42407
Author: Richard Hughes <richard>
Date:   Fri Jun 4 12:52:58 2010 +0100

    cnf: Add a MaxSearchTime entry in CommandNotFound.conf and default to 2000ms

Testing required.

Comment 6 Bug Zapper 2011-06-02 14:36:05 UTC
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: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Bug Zapper 2011-06-27 16:02:14 UTC
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.


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