[paramiko] Paramiko connection does not react well to sync
Robey Pointer
robey at tavi.lag.net
Fri Aug 24 11:21:41 PDT 2007
On 24 Jul 2007, at 8:59, Matthews, James wrote:
> Greetings,
>
> I have been furiously testing a Python (v2.4.3)
> application built on wx.Python (v) that uses paramiko (v1.7) for an
> SSH connection to essentially a “bare-bones” Linux box running
> dropbear (v0.49). The setup was working great except for one
> annoying bug that kept popping up in different locations. Namely,
> it appears to happen in very random places during a very long
> process in which the application connects to the Linux box, moves a
> few files around, updates the image on the box, and then mounts two
> particular partitions to restore some files (namely for convenience
> so I don’t have to do it manually after the image update). Now the
> problem appeared after somebody else went in and added some lines
> of code which they thought would make this process more reliable.
> I don’t know if this is exactly what was causing the problem, but
> after weeks of debugging, tracing, and cursing I found what I
> believe the problem to be. Apparently, they had added a function
> to open a new session to execute a Linux command on the box, which
> just so happened to be the ‘sync’ command. They had put this in
> after every time I mounted a partition in order to access it, and
> their comments said something along the lines of, “#Make sure the
> File System is aware”, or “#Give the File System time before
> accessing the file”. It seems that around this command in the
> code, the 10 second connection check would sense a downed connection.
>
> I’m sorry for the length of this email, but basically
> my question is… Is it even necessary to perform a ‘sync’ operation
> after just a simple partition mount? And further more, would it
> make any sense for this to cause paramiko to close the Transport
> unexpectedly?
Sorry for the late reply; I've been on vacation.
I can't think of a reason why a 'sync' would cause paramiko to
disconnect. But I also don't think it's necessary. The 'mount'
command should not complete until the filesystem is mounted. Maybe
someone else can correct me if I'm wrong.
robey
More information about the paramiko
mailing list