SFTP connection cache should be removed

Bug #43731 reported by Robert Collins
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
Vincent Ladeuil

Bug Description

The connection cache does not prevent the UI asking for passwords more than once: its a cache. We should provide a guarantee for each command, and once we do the work to provide that, the cache will not be needed.

This requires making the SFTP stub server acceptable multiple requests (because we do want tests to connect twice in various circumstances).

Related branches

Revision history for this message
Robert Collins (lifeless) wrote :

robey, I'd love if if you can tackle the first bit of this - making the stub server accept multiple connections.

Changed in bzr:
assignee: nobody → robey
description: updated
Revision history for this message
Robey Pointer (robey) wrote : let SFTPServer handle multiple connections

here's a patch that changes SingleListener to SocketListener and keeps listening for new connections until explicitly asked to stop (via TestCase.tearDown).

this lets the sftp unit tests continue to pass, but that means nothing since they don't try to use multiple connections yet. :)

if i comment out the connection cache using this patch, one of the tests locks up pretty quickly. i haven't had a chance to look at that yet, but i will continue later.

Revision history for this message
Robey Pointer (robey) wrote : corrected patch

Ah, found out what the problem was and was a simple fix. Since the loopback socket version is just handling sftp requests inline, and transports are never "closed", we can't wait around for the socket to be closed. So I just spin it off into a new thread each time.

With this patch, I can comment out the connection cache, and the unit tests still pass -- except for one which is trying to verify that the connection cache is working. :)

Robey Pointer (robey)
Changed in bzr:
assignee: robey → lifeless
Revision history for this message
John A Meinel (jameinel) wrote :

I believe the agreed upon fix is to be able to supply additional transport objects to 'get_transport()' and ask it to re-use them if it can.

This needs to propagate up the stack a bit (so Branch.open_containing() might take a list of transports to re-use).

But this makes the 'cache' a very localized operation, and not global througout bzrlib.

John A Meinel (jameinel)
Changed in bzr:
status: Unconfirmed → Confirmed
Revision history for this message
Vincent Ladeuil (vila) wrote :

Patch available shortly, hope robert don't mind that I assigned it to myself ;-)

Changed in bzr:
assignee: lifeless → v-ladeuil
Vincent Ladeuil (vila)
Changed in bzr:
status: Confirmed → In Progress
Vincent Ladeuil (vila)
Changed in bzr:
status: In Progress → Fix Committed
Vincent Ladeuil (vila)
Changed in bzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.