代码之家  ›  专栏  ›  技术社区  ›  Wolfgang Kerzendorf

并行python错误:RuntimeError(“套接字连接中断”)

  •  3
  • Wolfgang Kerzendorf  · 技术社区  · 14 年前

    import pp
    nodes=('mosura02','mosura03','mosura04','mosura05','mosura06',
           'mosura09','mosura10','mosura11','mosura12')
    nodes=('miner:60001',)
    def pptester():
    
       js=pp.Server(ppservers=nodes)
       js.set_ncpus(0)
       tmp=[]
       for i in range(200):
          tmp.append(js.submit(ppworktest,(),(),('os',)))
       return tmp
    
    def ppworktest():
       import os
       return os.system("uname -a")
    

    结果是:

    wkerzend@mosura:/home/wkerzend/tmp/ppython_test>ssh miner "source ~/coala_python_setup.sh;ppserver.py -d -p 60001"
    2010-04-12 00:50:48,162 - pp - INFO - Creating server instance (pp-1.6.0)
    2010-04-12 00:50:52,732 - pp - INFO - pp local server started with 32 workers
    2010-04-12 00:50:52,732 - pp - DEBUG - Strarting network server interface=0.0.0.0 port=60001
    Exception in thread client_socket:
    Traceback (most recent call last):
      File "/usr/lib64/python2.6/threading.py", line 525, in __bootstrap_inner
        self.run()
      File "/usr/lib64/python2.6/threading.py", line 477, in run
        self.__target(*self.__args, **self.__kwargs)
      File "/home/wkerzend/python_coala/bin/ppserver.py", line 161, in crun
        ctype = mysocket.receive()
      File "/home/wkerzend/python_coala/lib/python2.6/site-packages/pptransport.py", line 178, in receive
        raise RuntimeError("Socket connection is broken")
    RuntimeError: Socket connection is broken
    
    0 回复  |  直到 14 年前
    推荐文章