From 3395a7e1546bcf9df194d17b145ef615959300e5 Mon Sep 17 00:00:00 2001
From: david-sarah <david-sarah@jacaranda.org>
Date: Sat, 29 May 2010 21:08:09 -0700
Subject: [PATCH] SFTP: more logging to track down OpenOffice hang.

---
 src/allmydata/frontends/sftpd.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/allmydata/frontends/sftpd.py b/src/allmydata/frontends/sftpd.py
index 0d459f6e..368f91cc 100644
--- a/src/allmydata/frontends/sftpd.py
+++ b/src/allmydata/frontends/sftpd.py
@@ -1085,10 +1085,15 @@ class SFTPUserHandler(ConchUser, PrefixingLogMixin):
         if userpath in self._heisenfiles:
             files += self._heisenfiles[userpath]
 
+        if noisy: self.log("files = %r in %r" % (files, request), level=NOISY)
+
         d = defer.succeed(None)
         for f in files:
             if f is not ignore:
-                d.addBoth(lambda ign: f.sync())
+                def _sync(ign):
+                    if noisy: self.log("_sync %r in %r" % (f, request), level=NOISY)
+                    f.sync()
+                d.addBoth(_sync)
 
         def _done(ign):
             self.log("done %r" % (request,), level=OPERATIONAL)
@@ -1097,7 +1102,7 @@ class SFTPUserHandler(ConchUser, PrefixingLogMixin):
         return d
 
     def _remove_heisenfile(self, userpath, parent, childname, file_to_remove):
-        if noisy: self.log("._remove_file(%r, %r, %r, %r)" % (userpath, parent, childname, file_to_remove), level=NOISY)
+        if noisy: self.log("._remove_heisenfile(%r, %r, %r, %r)" % (userpath, parent, childname, file_to_remove), level=NOISY)
 
         direntry = self._direntry_for(parent, childname)
         if direntry in all_heisenfiles:
-- 
2.45.2