[apt-proxy-devel] r664 - in trunk: apt_proxy debian

Chris Halls halls at alioth.debian.org
Wed Jul 4 10:41:20 UTC 2007


Author: halls
Date: Wed Jul  4 10:41:20 2007
New Revision: 664

Log:
* Merge old 1.3.7 changelog to help BTS
* Remove a client from download queue when request is aborted
* Add changelog for 1.9.37


Modified:
   trunk/apt_proxy/apt_proxy.py
   trunk/apt_proxy/fetchers.py
   trunk/debian/changelog

Modified: trunk/apt_proxy/apt_proxy.py
==============================================================================
--- trunk/apt_proxy/apt_proxy.py	(original)
+++ trunk/apt_proxy/apt_proxy.py	Wed Jul  4 10:41:20 2007
@@ -111,7 +111,7 @@
     def entry_done(self, entry):
         "A cache entry is finished and clients are disconnected"
         #if self.entries.has_key(entry.path):
-        log.debug("entry_done: %s" %(entry.path), 'Backend')
+        log.debug("entry_done: %s (%s left)" %(entry.path, len(self.entries)-1), 'Backend')
         try:
             del self.entries[entry.path]
         except KeyError:
@@ -142,6 +142,13 @@
         """
         self.queue.addFile(entry)
 
+    def stop_download(self, entry, request):
+        """
+        A request has been removed from a cache entry - stop download
+        """
+        if self.queue:
+            self.queue.removeFile(entry, request)
+
     def close(self):
         "Clean up backend and associated structures"
         if self.queue is not None:

Modified: trunk/apt_proxy/fetchers.py
==============================================================================
--- trunk/apt_proxy/fetchers.py	(original)
+++ trunk/apt_proxy/fetchers.py	Wed Jul  4 10:41:20 2007
@@ -911,6 +911,23 @@
         else:
             log.debug("queue file " + cacheEntry.cache_path, 'DownloadQueue')
 
+    def removeFile(self, cacheEntry):
+        """
+        Remove a file from a queue
+        Necessary if a download is aborted
+        """
+        path = cacheEntry.cache_path
+
+        if self.activeFile == cacheEntry:
+            self.stop()
+            if len(self.queue) > 1:
+                self.startNextDownload()
+        else:
+            try:
+                self.queue.remove(cacheEntry)
+            except ValueError:
+                pass
+
     def downloadFinished(self, result):
         success, message = result
         if success:
@@ -925,7 +942,7 @@
             self.activeFile = self.queue[0]
             self.queue = self.queue[1:]
 
-            if self.activeFile.state != self.activeFile.STATE_NEW:
+            if not self.activeFile.state in (self.activeFile.STATE_CONNECTING, self.activeFile.STATE_DOWNLOAD):
                 log.debug("active download skipped (%s)" % (self.activeFile.cache_path), 'DownloadQueue')
                 self.activeFile = None
                 continue # Go to next file
@@ -933,6 +950,10 @@
             log.debug("start next download (%s)" % (self.activeFile.cache_path), 'DownloadQueue')
 
             if self.fetcher is not None:
+	    	log.debug("server:%s activeFile:%s" % (self.fetcher.backendServer,self.activeFile))
+		#test code to break downloads
+		#self.test=None
+		#print self.test.foo
                 if self.fetcher.backendServer.backend != self.activeFile.backend:
                     log.debug("old:%s new:%s" %(self.fetcher.backendServer.backend,self.activeFile.backend) 
                               , 'DownloadQueue')
@@ -988,6 +1009,7 @@
             clientId = req.getFileno()
 
             if self.queues.has_key(clientId):
+                log.debug("Adding file to existing queue for client id %s" % (clientId), 'DownloadQueuePerClient')
                 q = self.queues[clientId]
             else:
                 q = DownloadQueue([self, clientId])
@@ -996,6 +1018,17 @@
 
             q.addFile(cacheEntry)
 
+    def removeFile(self, cacheEntry, request):
+        """
+        Remove queue entry, used when a download is finished
+        """
+        clientId = request.getFileno()
+        log.debug("removeFile: clientID %s" % clientId)
+        try:
+            self.queues[clientId].removeFile(cacheEntry)
+        except KeyError:
+            pass
+
     def downloadQueueEmpty(self, queue, data):
         """
         DownloadQueue notifies that it is empty

Modified: trunk/debian/changelog
==============================================================================
--- trunk/debian/changelog	(original)
+++ trunk/debian/changelog	Wed Jul  4 10:41:20 2007
@@ -1,3 +1,16 @@
+apt-proxy (1.9.37) UNRELEASED; urgency=low
+
+  * Ensure that the status of a file is always reset, even if the download
+    does not complete (Closes: #428505)
+  * Add a generic error handler for unknown exceptions when a client requests a
+    file. This is the start of making apt-proxy fail safely by resetting its
+    internal state when something strange happens.
+  * Merge 1.3.7 changelog into main changelog to help BTS understand which bugs
+    were already closed
+  * Add more unit tests
+
+ -- Chris Halls <halls at debian.org>  Wed, 04 Jul 2007 11:40:22 +0100
+
 apt-proxy (1.9.36) unstable; urgency=low
 
   [ Chris Halls ]
@@ -683,6 +696,31 @@
 
  -- Chris Halls <chris.halls at gmx.de>  Tue, 16 Jul 2002 22:30:10 +0200
 
+apt-proxy (1.3.7) testing-proposed-updates; urgency=low
+
+  * Resurrect version 1 for Sarge, because version 2 is still not
+    stable enough to go into stable
+  * When GNU sleep is available, sleep for smaller periods of time.  This
+    increases apt-proxy's responsiveness on faster machines.
+  * Explicitly tell rsync which directory to use for its temporary files.
+    (closes: #187094)
+  * Add See also: apt-proxy-import to apt-proxy(8)
+  * Fix apt-proxy.conf path in French manpage, thanks to Julien Louis
+  * Prevent shell expansion of input lines
+  * Add section about backing up the apt-proxy cache to FAQ
+  * Update apt-proxy.conf manpage:
+     - Clarify that MAX_VERSIONS is the only parameter that uses Packages
+       files
+     - Document WGET option, thanks Andree Leidenfrost (closes: #190926)
+     - Document DEBUG option (closes: #194185)
+     - Make it clear that apt-proxy does not need to be reloaded for changes
+       to take effect
+  * Update README:
+     - Remove section about Debian Potato
+     - Add FAQ about backing up apt-proxy cache
+
+ -- Chris Halls <halls at debian.org>  Wed,  3 Nov 2004 17:39:10 +0000
+
 apt-proxy (1.3.6) unstable; urgency=low
 
   * Correct example proxy lines in apt-proxy.conf (closes: #169658, #177514)



More information about the apt-proxy-devel mailing list