Opened 5 years ago

Closed 5 years ago

#6145 defect closed duplicate (duplicate)

Infinite loop in twisted.names.client._connectedProtocol

Reported by: Henry Stern Owned by:
Priority: normal Milestone:
Component: names Keywords: infinite loop
Cc: Branch:
Author:

Description

The twisted.names.client._connectedProtocol function goes into an infinite loop if it cannot create a new socket because your host is either out of ports or you have exceeded ulimit.

File "/Library/Python/2.7/site-packages/twisted/names/client.py", line 231, in _connectedProtocol

An easy way to reproduce this is:

from twisted.names import client from twisted.internet import reactor resolver = client.Resolver('/etc/resolv.conf') for i in xrange(0,100000):

resolver.lookupAddress(str(i))

reactor.run()

This will cause an infinite loop on line 5.

Change History (2)

comment:1 Changed 5 years ago by Henry Stern

Proper formatting of code example:

from twisted.names import client
from twisted.internet import reactor
resolver = client.Resolver('/etc/resolv.conf')
for i in xrange(0,100000):
    resolver.lookupAddress(str(i))
reactor.run()

comment:2 Changed 5 years ago by Jean-Paul Calderone

Resolution: duplicate
Status: newclosed

Duplicate of #5048.

Note: See TracTickets for help on using tickets.