[merge][#109520] gc of LockableFiles should not warn or unlock
John Arbash Meinel
john at arbash-meinel.com
Wed Mar 19 23:15:18 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Martin Pool wrote:
| https://bugs.launchpad.net/bzr/+bug/109520
| https://bugs.launchpad.net/bzr/+bug/137387
|
| The __del__ method of LockableFiles complains if the object was not
| unlocked before being destroyed. This may indicate a bug where we did
| not match a finally/unlock with the lock, though it can also commonly
| occur in other cases, such as losing the transport and therefore not
| being able to unlock the files, or a failure in another finally block.
|
| Ideally we would detect the static errors and turn them in to test
| suite failures. However, gc is a poor way to do this because it's
| hard to map the failure back to the code that locked it, and the gc
| may not happen until after the relevant test has finished. I'm not
| sure it's a big deal because it's relatively easy to detect in code
| review that a finally block is needed.
|
| I think it's poor to show it to users by default, since they cannot do
| anything about it and probably rarely feel like reporting it, nor do
| they have much information to report.
|
| In the test suite to me it seems to clutter the output without
| particularly helping debugging.
|
| Having thought this through, I actually want to take this one step
| further and remove the unlock call from the del method. Leaving
| something locked is not so bad, trying to unlock when we may be
| disconnected from the server causes knock-on failures, and in general
| we try to avoid doing anything substantial from del methods.
|
|
Well, I feel like sweeping it under the rug is hiding something which is broken
in our test suite.
But otherwise:
BB:approve
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFH4Z6GJdeBCYSNAAMRAuEtAJ4vjtDCmRRU/JDJgu/Vn2nj3xWI8QCfUeIs
MHFhloo6/ylPHUXfWgsWueo=
=SHst
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list