Index: tests/regressiontests/file_uploads/views.py
===================================================================
--- tests/regressiontests/file_uploads/views.py	(revision 8739)
+++ tests/regressiontests/file_uploads/views.py	(working copy)
@@ -3,7 +3,7 @@
 from django.http import HttpResponse, HttpResponseServerError
 from django.utils import simplejson
 from models import FileModel
-from uploadhandler import QuotaUploadHandler
+from uploadhandler import QuotaUploadHandler, ErroringUploadHandler
 from django.utils.hashcompat import sha_constructor
 
 def file_upload_view(request):
@@ -84,3 +84,7 @@
     for key in request.FILES.keys():
         file_counts[key] = len(request.FILES.getlist(key))
     return HttpResponse(simplejson.dumps(file_counts))
+
+def file_upload_errors(request):
+    request.upload_handlers.insert(0, ErroringUploadHandler())
+    return file_upload_echo(request)
Index: tests/regressiontests/file_uploads/tests.py
===================================================================
--- tests/regressiontests/file_uploads/tests.py	(revision 8739)
+++ tests/regressiontests/file_uploads/tests.py	(working copy)
@@ -10,7 +10,21 @@
 from django.utils.hashcompat import sha_constructor
 
 from models import FileModel, temp_storage, UPLOAD_TO
+import uploadhandler
 
+
+class POSTAccessingHandler(client.ClientHandler):
+
+    """A handler meant to expose bug #8622."""
+
+    def handle_uncaught_exception(self, request, resolver, exc_info):
+        """Extended to try to access request.POST, which should be safe to do."""
+        ret = super(POSTAccessingHandler, self).handle_uncaught_exception(request, resolver, exc_info)
+        # accessing request.POST should be safe:
+        p = request.POST
+        return ret
+
+
 class FileUploadTests(TestCase):
     def test_simple_upload(self):
         post_data = {
@@ -20,6 +34,36 @@
         response = self.client.post('/file_uploads/upload/', post_data)
         self.assertEqual(response.status_code, 200)
 
+    def test_bug_8622(self):
+        """The server should not block on read when there are upload errors (bug #8622)"""
+        post_data = {
+            'name': 'Ringo',
+            'file_field': open(__file__),
+        }
+        # Maybe this is a little more complicated that it needs to be; but if
+        # the django.test.client.FakePayload.read() implementation changes then
+        # this test would fail.  So we need to know exactly what kind of error
+        # it raises when there is an attempt to read more than the available bytes:
+        try:
+            client.FakePayload('a').read(2)
+        except Exception, reference_error:
+            pass
+
+        # install the custom handler that tries to access request.POST
+        self.client.handler = POSTAccessingHandler()
+
+        try:
+            response = self.client.post('/file_uploads/upload_errors/', post_data)
+        except reference_error.__class__, err:
+            block_on_read = False
+            if str(err) == str(reference_error):
+                block_on_read = True
+            self.failIf(block_on_read)
+        except Exception, err:
+            # CustomUploadError is the error that should have been raised
+            self.assertEqual(err.__class__, uploadhandler.CustomUploadError)
+
+
     def test_large_upload(self):
         tdir = tempfile.gettempdir()
 
Index: tests/regressiontests/file_uploads/uploadhandler.py
===================================================================
--- tests/regressiontests/file_uploads/uploadhandler.py	(revision 8739)
+++ tests/regressiontests/file_uploads/uploadhandler.py	(working copy)
@@ -23,4 +23,16 @@
         return raw_data
             
     def file_complete(self, file_size):
-        return None
\ No newline at end of file
+        return None
+
+
+class CustomUploadError(Exception):
+    pass
+
+
+class ErroringUploadHandler(FileUploadHandler):
+
+    """A handler that raises a custom exception."""
+
+    def receive_data_chunk(self, raw_data, start):
+        raise CustomUploadError
Index: tests/regressiontests/file_uploads/urls.py
===================================================================
--- tests/regressiontests/file_uploads/urls.py	(revision 8739)
+++ tests/regressiontests/file_uploads/urls.py	(working copy)
@@ -8,4 +8,5 @@
     (r'^quota/$',           views.file_upload_quota),
     (r'^quota/broken/$',    views.file_upload_quota_broken),
     (r'^getlist_count/$',   views.file_upload_getlist_count),
+    (r'^upload_errors/$',   views.file_upload_errors),
 )
