Merge lp:~jameinel/bzr/test-traceback-767177 into lp:bzr
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merge reported by: | Martin Packman | ||||||||
Merged at revision: | not available | ||||||||
Proposed branch: | lp:~jameinel/bzr/test-traceback-767177 | ||||||||
Merge into: | lp:bzr | ||||||||
Diff against target: |
227 lines (+71/-44) 7 files modified
bzr (+2/-2) bzrlib/tests/per_transport.py (+13/-4) bzrlib/transport/__init__.py (+34/-31) bzrlib/transport/sftp.py (+2/-5) doc/en/release-notes/bzr-2.4.txt (+9/-0) doc/en/whats-new/whats-new-in-2.4.txt (+9/-0) setup.py (+2/-2) |
||||||||
To merge this branch: | bzr merge lp:~jameinel/bzr/test-traceback-767177 | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Pool | Needs Fixing | ||
Martin Packman (community) | Abstain | ||
Jelmer Vernooij (community) | Approve | ||
Review via email: mp+58505@code.launchpad.net |
Commit message
Be more agressive about closing file handles. (bug #767177). This patch breaks python-2.4 compatibility.
Description of the change
With this patch, I no longer get ugly Thread tracebacks running:
bzr selftest -s bt.per_transport --parallel=fork
Basically it does 3 things:
1) Break compatibility with python2.4 by using a try/finally in a generator
2) Be more aggressive about calling fp.close() in readv methods.
3) Handle the cases where we were calling get_multi() but not doing anything with the returned File objects, leaving them with both a pending _prefetch() call and a pending _close() call.
I started a mailing list discussion about the python-2.4 breakage, and I expect to block until that thread seems to have petered out. But I think all of this is worthwhile, and makes our test suite nicer.
+1 on the code and breaking 2.4 compatibility. Perhaps this should stall for a bit to give people time to object on the mailing list.