Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行一段时间后会报错并中断获取新的Hash #2

Open
decdfgfe opened this issue Feb 2, 2015 · 2 comments
Open

运行一段时间后会报错并中断获取新的Hash #2

decdfgfe opened this issue Feb 2, 2015 · 2 comments

Comments

@decdfgfe
Copy link

decdfgfe commented Feb 2, 2015

报错信息如下,还望分析一下具体是什么原因导致
Exception happened during processing of request fromException happened during pr
ocessing of request from (('176.195.232.173''180.181.76.106', , 5337051413)
)Traceback (most recent call last):

File "C:\Python\lib\SocketServer.py", line 295, in _handle_request_noblock
Traceback (most recent call last):
File "C:\Python\lib\SocketServer.py", line 599, in process_request_thread
Exception in thread Thread-6:
Traceback (most recent call last):
File "C:\Python\lib\threading.py", line 810, in __bootstrap_inner
self.run()
File "C:\Python\lib\threading.py", line 763, in run
self.__target(_self.__args, *_self.__kwargs)
File "C:\website\btdht\btdht.py", line 346, in iterative
node.get_peers(hash_id, socket=self.server.socket, sender_id=self.node._id)
File "C:\website\btdht\node.py", line 168, in get_peers
trans_id = self.add_trans("get_peers", info_hash)
File "C:\website\btdht\node.py", line 45, in add_trans
"access_time": int(time.time())
MemoryError

self.process_request(request, client_address)

File "C:\Python\lib\SocketServer.py", line 610, in process_request
t.start()
File "C:\Python\lib\threading.py", line 745, in start
_start_new_thread(self.__bootstrap, ())

error: can't start new thread

self.finish_request(request, client_address)

File "C:\Python\lib\SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python\lib\SocketServer.py", line 655, in init
self.handle()
File "C:\website\btdht\btdht.py", line 41, in handle
self.handle_response(message)
File "C:\website\btdht\btdht.py", line 72, in handle_response
logger.debug("We found apropriate node %r for %r" % (node, node_id.encode("h
ex")))
File "C:\website\btdht\node.py", line 36, in repr
return repr("%s %s:%d" % (self._id.encode('hex'), self.host, self.port))

MemoryError: stack overflow


Exception happened during processing of request from (--------------------------
--------------'112.66.47.189'

, Exception happened during processing of request from-------------------------

3894(Exception happened during processing of request fromException happened dur
ing processing of request from--------------------------------------------------
------------------------------)'91.202.57.100'

, ((Exception happened during processing of request fromException happened durin
g processing of request from----------------------------------------------------
----------------------------Traceback (most recent call last):
48862'115.231.212.93''182.99.98.105'

File "C:\Python\lib\SocketServer.py", line 599, in process_request_thread
), , ((Exception happened during processing of request fromException happened du
ring processing of request from
160017546'218.65.67.8''112.66.47.189' self.finish_request(request, client_a
ddress)
Traceback (most recent call last):
)), , ((

@NanYoMy
Copy link
Owner

NanYoMy commented Feb 6, 2015

你好,最近一直很忙,很抱歉这么就回复,我看了一下。during pr
ocessing of request from (('176.195.232.173''180.181.76.106', , 5337051413),先检查一下这个问题,没什么是两个ip?好像运行中我没记得会开启新线程啊,所有的线程都是一次性在最开始建立的,这个问题可以自己查看一下。如果是处理request经常会出错,还有种解决方法可以说直接把request处理注释了。你可以看一下这个git,https://github.com/NanYoMy/DHT-simDHT

@decdfgfe
Copy link
Author

decdfgfe commented Feb 7, 2015

报错的原因是内在耗尽了。
在for i in xrange 这里循环,内存没有释放(服务器1G内存),到100%的时候就会出错。
有没有什么方法可以循环后释放内存呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants