Shawn Walker wrote:
On 02/12/10 04:41 PM, John Rice wrote:
Shawn is this an API bug? When the api throws an exception such as
ImageLockedError I would expect any subsequent call to
api.can_be_canceled to return False.
We have logic on exit to kick off an api.cancel() in a separate thread
if api.can_be_canceled returns true. The thread never returns after an
ImageLockedError has been thrown previously and so PM doesn't exit
cleanly. We worked around it in the installer but I missed this in PM
itself.
The short answer is, maybe, maybe not. In a multi-threaded program
you could have had an operation already in progress at the time
another operation failed with an ImageLockedError. The operation
that's actually in progress itself could be cancelable.
It's conceivable that in a race condition scenario, you could end up
with a sequence like this:
1) Start_OP_A
2) Start_OP_B
3) OP_B_FAILS; can_be_canceled_TRUE
4) OP_A_Finishes
5) ... ?
It's also possible that an operation isn't setting can_be_canceled to
False when it's failing or completing. It's hard to say without being
able to consistently reproduce the issue and then trying to find
analyse the state at the point of unexpected failure.
The bug we are tracking (14552) is completely reproducible with PM in
the gate:
- Just start PM from the gate, click on Install on the Start Page for
say Wine.
- Click on the Proceed in the WebInstall, so its now acquired the lock.
- Then go to any package in the main list, right click and select
Package Version Info.
- You will get the ImageLockedError raised and displayed to the user.
- Then try and exit PM, it will never exit as a thread has been kicked
off in main application quit to api.cancel().
JR
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss