Issue46

Title mirrorprobe sometimes times out with an exception
Priority bug Status resolved
Superseder Nosy List poeml
Assigned To poeml Keywords

Created on 2010-03-27.15:10:54 by poeml, last changed by poeml.

Messages
msg166 (view) Author: poeml Date: 2010-03-27.15:20:57
r8022 | poeml | 2010-03-27 16:19:13 +0100 (Sat, 27 Mar 2010) | 8 lines

mirrorprobe:
- A hard-to-catch exception is now handled. If Python's socket module ran into
  a timeout while reading a chunked response, the exception would not be passed
  correctly to the upper layer, so it could not be caught by its name. We now
  wrap the entire thread into another exception, which would otherwise be bad
  practice, but is probably okay here, since we already catch all other exceptions.
msg165 (view) Author: poeml Date: 2010-03-27.15:10:53
There is a certain exception that the mirrorprobe might run into, which is not caught by the code, 
even though it should. Symptom:

Exception in thread probeThread-273:
Traceback (most recent call last):
 File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
   self.run()
 File "/usr/lib/python2.5/threading.py", line 446, in run
   self.__target(*self.__args, **self.__kwargs)
 File "/usr/bin/mirrorprobe", line 97, in probe_http
   mirror.response = e.read()
 File "/usr/lib/python2.5/socket.py", line 291, in read
   data = self._sock.recv(recv_size)
 File "/usr/lib/python2.5/httplib.py", line 509, in read
   return self._read_chunked(amt)
 File "/usr/lib/python2.5/httplib.py", line 544, in _read_chunked
   line = self.fp.readline()
 File "/usr/lib/python2.5/socket.py", line 331, in readline
   data = recv(1)
timeout: timed out


The code _does_ have exception handling for this case. However, the exception, which happens deep 
in the socket module, is not correctly passed to upper layers. Thus, there doesn't seem to be a way 
to get hold of it.

In trunk, I have now wrapped the entire thread code into another try-except block. That is ugtly, 
but helps.
History
Date User Action Args
2010-03-27 15:20:57poemlsetstatus: testing -> resolved
messages: + msg166
2010-03-27 15:10:54poemlcreate