report: bzr selftest hangs on win32

Alexander Belchenko bialix at ukr.net
Thu Sep 21 14:27:31 BST 2006


Andrew Bennetts пишет:
> On Thu, Sep 21, 2006 at 01:20:00PM +1000, Andrew Bennetts wrote:
>> On Wed, Sep 20, 2006 at 12:23:20PM +0300, Alexander Belchenko wrote:
> [...]
>>>   File "D:\Bazaar\sandbox\bzr.dev\bzrlib\transport\smart.py", line 172,
>>> in _recv_tuple
>>>     req_line = from_file.readline()
>>>   File "E:\Python24\lib\socket.py", line 340, in readline
>>>     data = self._sock.recv(self._rbufsize)
>>> error: (10035, 'The socket operation could not complete without blocking')
>> This is odd.  It may be the cause of some of the test failures, but I'm not sure
>> why that socket would be non-blocking... oh, it's probably because of this line in
>> SmartTCPServer.__init__:
>>
>>         self._server_socket.settimeout(1)
>>
>> socket.settimeout works internally by making the socket non-blocking.
>>
>> Alexander, could you try commenting out that line and see if it helps?
> 
> It might be that on windows accepted sockets inherit non-blockingness from the
> listening socket?  That doesn't seem to happen on linux.  That would explain
> this problem.
> 
> If so, this patch might help:
> 
> === modified file 'bzrlib/transport/smart.py'
> --- bzrlib/transport/smart.py   2006-09-18 09:58:40 +0000
> +++ bzrlib/transport/smart.py   2006-09-21 03:35:32 +0000
> @@ -519,6 +519,7 @@
>      def accept_and_serve(self):
>          conn, client_addr = self._server_socket.accept()
>          conn.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
> +        conn.setblocking(False)
>          from_client = conn.makefile('r')
>          to_client = conn.makefile('w')
>          handler = SmartStreamServer(from_client, to_client,
> 

Result after this patch:

$ python bzr --no-plugins selftest -v
test_smart_transport.WritableEndToEndTests.test_get_error_enoent

        bzr: D:/Bazaar/sandbox/andrew.smart-server/bzr
     bzrlib: D:\Bazaar\sandbox\andrew.smart-server\bzrlib

running tests...
test_smart_transport.WritableEndToEndTests.test_get_error_enoent
                                     OK         169ms

----------------------------------------------------------------------
Ran 1 test in 0.190s

OK
tests passed
<bzrlib.transport.smart.SmartStreamServer object at 0x01CEDC50>
terminating on exception 'NoneType' object is not callable
Exception in thread smart-server-child (most likely raised during
interpreter shutdown):
Traceback (most recent call last):
   File "E:\Python24\lib\threading.py", line 442, in __bootstrap
   File "E:\Python24\lib\threading.py", line 422, in run
   File
"D:\Bazaar\sandbox\andrew.smart-server\bzrlib\transport\smart.py", line
306, in serve
   File
"D:\Bazaar\sandbox\andrew.smart-server\bzrlib\transport\smart.py", line
284, in _serve_one_request
   File
"D:\Bazaar\sandbox\andrew.smart-server\bzrlib\transport\smart.py", line
268, in _recv_tuple
exceptions.TypeError: 'NoneType' object is not callable


The same traceback again.

--
Alexander





More information about the bazaar mailing list