Bug 494048

Summary: command-not-found handler hangs waiting for package manager lock
Product: [Fedora] Fedora Reporter: M Hickford <matt.hickford>
Component: PackageKitAssignee: Richard Hughes <richard>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: lmacken, richard, robin.norwood, smparrish
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-15 16:23:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description M Hickford 2009-04-03 20:53:34 UTC
Description of problem:
The command-not-found handler hangs if another application has the package manager lock.

Steps to Reproduce:
1. Install packagekit-command-not-found
2. Use the Add/Remove software application, or Update System, or run a yum command so that an application has the package manager lock
3. Open a terminal
4. Run a command found in a Fedora package but not installed on your system, eg. 'sl'

Expected results:
'Command not found. Install package 'sl' to provide command 'sl'? [N/y]'  

Actual results:
'Command not found.'
(hangs until package manager lock is released)

This is frustrating, as the handler is intended to speed up using the terminal, and this is an unexplained hang when most users having read 'Command not found' expect to have been immediately returned to the prompt.

Of course, does the handler need the package lock? If it were to cache the list periodically, could it be as snappy as "bash: command not found."? 


Aside: I'm torn between whether I prefer the functionality of this handler or the one in Ubuntu. Ubuntu prints the name of the package and returns, PackageKit asks the user if they want to install the package and waits for an answer. The latter interrupts flow if you mistype 'sl' for 'ls', but if you did intend the command, it gets the package and then executes your command for you which is damn cool :)

Comment 1 Richard Hughes 2009-04-06 09:27:52 UTC
(In reply to comment #0)
> Of course, does the handler need the package lock?

Yes, yum can't query the database without the lock.

> Aside: I'm torn between whether I prefer the functionality of this handler or
> the one in Ubuntu. Ubuntu prints the name of the package and returns,
> PackageKit asks the user if they want to install the package and waits for an
> answer. The latter interrupts flow if you mistype 'sl' for 'ls', but if you did
> intend the command, it gets the package and then executes your command for you
> which is damn cool :)  

You can configure all this stuff in /etc/PackageKit/CommandNotFound.conf