brendano / stanford_corenlp_pywrapper

151 stars 59 forks source link

socket timeout kills program #16

Closed brendano closed 9 years ago

brendano commented 9 years ago

socket timeout doesn't seem to get caught? i think this is happening in a place it's not supposed to -- when it's connecting the new socket. this isn't related to the 5-minute timeout on parsing a document.

Traceback (most recent call last):
  File "proc.py", line 25, in <module>
    head_jdoc = ss.parse_doc(headline_text)
  File "/home/brenocon/gigaword/new_proc_of_rawgw/stanford_corenlp_pywrapper/sockwrap.py", line 139, in parse_doc
    return self.send_command_and_parse_result(cmd, timeout, raw=raw)
  File "/home/brenocon/gigaword/new_proc_of_rawgw/stanford_corenlp_pywrapper/sockwrap.py", line 150, in send_command_and_parse_result
    data = self.send_command_and_get_string_result(cmd, timeout)
  File "/home/brenocon/gigaword/new_proc_of_rawgw/stanford_corenlp_pywrapper/sockwrap.py", line 170, in send_command_and_get_string_result
    sock = self.get_socket()
  File "/home/brenocon/gigaword/new_proc_of_rawgw/stanford_corenlp_pywrapper/sockwrap.py", line 144, in get_socket
    sock.connect(('localhost', self.server_port))
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 110] Connection timed out
WARNING:StanfordSocketWrap:Killing subprocess 1217
brendano commented 9 years ago

processing afp_eng_200206 (gigaword 5) with 17539 input documents, using ner + shift-reduce parsing

first try failed after 5099 lines output next try, after adding timeouts for the socket connect, failed with 14808 lines output, try again got 14810 lines output

Traceback (most recent call last):
  File "proc.py", line 26, in <module>
    head_jdoc = ss.parse_doc(headline_text)
  File "/home/brenocon/gigaword/new_proc_of_rawgw/stanford_corenlp_pywrapper/sockwrap.py", line 143, in parse_doc
    return self.send_command_and_parse_result(cmd, timeout, raw=raw)
  File "/home/brenocon/gigaword/new_proc_of_rawgw/stanford_corenlp_pywrapper/sockwrap.py", line 162, in send_command_and_parse_result
    data = self.send_command_and_get_string_result(cmd, timeout)
  File "/home/brenocon/gigaword/new_proc_of_rawgw/stanford_corenlp_pywrapper/sockwrap.py", line 183, in send_command_and_get_string_result
    sock = self.get_socket()
  File "/home/brenocon/gigaword/new_proc_of_rawgw/stanford_corenlp_pywrapper/sockwrap.py", line 157, in get_socket
    assert False, "couldnt connect socket"
brendano commented 9 years ago

all lines went through with the prev commit