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.
--
Shawn Walker
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss